<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP, BangPatterns #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# OPTIONS_HADDOCK prune #-}</span><span class="hs-cpp">
#if __GLASGOW_HASKELL__ &gt;= 701
</span><span class="hs-pragma">{-# LANGUAGE Trustworthy #-}</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- Module      : Data.ByteString.Lazy.Char8</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- Copyright   : (c) Don Stewart 2006-2008</span><span>
</span><span id="line-10"></span><span class="hs-comment">--               (c) Duncan Coutts 2006-2011</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- License     : BSD-style</span><span>
</span><span id="line-12"></span><span class="hs-comment">--</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- Maintainer  : dons00@gmail.com, duncan@community.haskell.org</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- Stability   : stable</span><span>
</span><span id="line-15"></span><span class="hs-comment">-- Portability : portable</span><span>
</span><span id="line-16"></span><span class="hs-comment">--</span><span>
</span><span id="line-17"></span><span class="hs-comment">-- Manipulate /lazy/ 'ByteString's using 'Char' operations. All Chars will</span><span>
</span><span id="line-18"></span><span class="hs-comment">-- be truncated to 8 bits. It can be expected that these functions will</span><span>
</span><span id="line-19"></span><span class="hs-comment">-- run at identical speeds to their 'Data.Word.Word8' equivalents in</span><span>
</span><span id="line-20"></span><span class="hs-comment">-- &quot;Data.ByteString.Lazy&quot;.</span><span>
</span><span id="line-21"></span><span class="hs-comment">--</span><span>
</span><span id="line-22"></span><span class="hs-comment">-- This module is intended to be imported @qualified@, to avoid name</span><span>
</span><span id="line-23"></span><span class="hs-comment">-- clashes with &quot;Prelude&quot; functions.  eg.</span><span>
</span><span id="line-24"></span><span class="hs-comment">--</span><span>
</span><span id="line-25"></span><span class="hs-comment">-- &gt; import qualified Data.ByteString.Lazy.Char8 as C</span><span>
</span><span id="line-26"></span><span class="hs-comment">--</span><span>
</span><span id="line-27"></span><span class="hs-comment">-- The Char8 interface to bytestrings provides an instance of IsString</span><span>
</span><span id="line-28"></span><span class="hs-comment">-- for the ByteString type, enabling you to use string literals, and</span><span>
</span><span id="line-29"></span><span class="hs-comment">-- have them implicitly packed to ByteStrings.</span><span>
</span><span id="line-30"></span><span class="hs-comment">-- Use @{-\# LANGUAGE OverloadedStrings \#-}@ to enable this.</span><span>
</span><span id="line-31"></span><span class="hs-comment">--</span><span>
</span><span id="line-32"></span><span>
</span><span id="line-33"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Data.ByteString.Lazy.Char8</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-34"></span><span>
</span><span id="line-35"></span><span>        </span><span class="annot"><span class="hs-comment">-- * The @ByteString@ type</span></span><span>
</span><span id="line-36"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier">ByteString</span></a></span><span class="hs-special">,</span><span>             </span><span class="hs-comment">-- instances: Eq, Ord, Show, Read, Data, Typeable</span><span>
</span><span id="line-37"></span><span>
</span><span id="line-38"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Introducing and eliminating 'ByteString's</span></span><span>
</span><span id="line-39"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#empty"><span class="hs-identifier">empty</span></a></span><span class="hs-special">,</span><span>                  </span><span class="hs-comment">-- :: ByteString</span><span>
</span><span id="line-40"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#singleton"><span class="hs-identifier">singleton</span></a></span><span class="hs-special">,</span><span>              </span><span class="hs-comment">-- :: Char   -&gt; ByteString</span><span>
</span><span id="line-41"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#pack"><span class="hs-identifier">pack</span></a></span><span class="hs-special">,</span><span>                   </span><span class="hs-comment">-- :: String -&gt; ByteString</span><span>
</span><span id="line-42"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#unpack"><span class="hs-identifier">unpack</span></a></span><span class="hs-special">,</span><span>                 </span><span class="hs-comment">-- :: ByteString -&gt; String</span><span>
</span><span id="line-43"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#fromChunks"><span class="hs-identifier">fromChunks</span></a></span><span class="hs-special">,</span><span>             </span><span class="hs-comment">-- :: [Strict.ByteString] -&gt; ByteString</span><span>
</span><span id="line-44"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#toChunks"><span class="hs-identifier">toChunks</span></a></span><span class="hs-special">,</span><span>               </span><span class="hs-comment">-- :: ByteString -&gt; [Strict.ByteString]</span><span>
</span><span id="line-45"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#fromStrict"><span class="hs-identifier">fromStrict</span></a></span><span class="hs-special">,</span><span>             </span><span class="hs-comment">-- :: Strict.ByteString -&gt; ByteString</span><span>
</span><span id="line-46"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#toStrict"><span class="hs-identifier">toStrict</span></a></span><span class="hs-special">,</span><span>               </span><span class="hs-comment">-- :: ByteString -&gt; Strict.ByteString</span><span>
</span><span id="line-47"></span><span>
</span><span id="line-48"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Basic interface</span></span><span>
</span><span id="line-49"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#cons"><span class="hs-identifier">cons</span></a></span><span class="hs-special">,</span><span>                   </span><span class="hs-comment">-- :: Char -&gt; ByteString -&gt; ByteString</span><span>
</span><span id="line-50"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#cons%27"><span class="hs-identifier">cons'</span></a></span><span class="hs-special">,</span><span>                  </span><span class="hs-comment">-- :: Char -&gt; ByteString -&gt; ByteString</span><span>
</span><span id="line-51"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#snoc"><span class="hs-identifier">snoc</span></a></span><span class="hs-special">,</span><span>                   </span><span class="hs-comment">-- :: ByteString -&gt; Char -&gt; ByteString</span><span>
</span><span id="line-52"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#append"><span class="hs-identifier">append</span></a></span><span class="hs-special">,</span><span>                 </span><span class="hs-comment">-- :: ByteString -&gt; ByteString -&gt; ByteString</span><span>
</span><span id="line-53"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#head"><span class="hs-identifier">head</span></a></span><span class="hs-special">,</span><span>                   </span><span class="hs-comment">-- :: ByteString -&gt; Char</span><span>
</span><span id="line-54"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#uncons"><span class="hs-identifier">uncons</span></a></span><span class="hs-special">,</span><span>                 </span><span class="hs-comment">-- :: ByteString -&gt; Maybe (Char, ByteString)</span><span>
</span><span id="line-55"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#last"><span class="hs-identifier">last</span></a></span><span class="hs-special">,</span><span>                   </span><span class="hs-comment">-- :: ByteString -&gt; Char</span><span>
</span><span id="line-56"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#tail"><span class="hs-identifier">tail</span></a></span><span class="hs-special">,</span><span>                   </span><span class="hs-comment">-- :: ByteString -&gt; ByteString</span><span>
</span><span id="line-57"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#unsnoc"><span class="hs-identifier">unsnoc</span></a></span><span class="hs-special">,</span><span>                 </span><span class="hs-comment">-- :: ByteString -&gt; Maybe (ByteString, Char)</span><span>
</span><span id="line-58"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#init"><span class="hs-identifier">init</span></a></span><span class="hs-special">,</span><span>                   </span><span class="hs-comment">-- :: ByteString -&gt; ByteString</span><span>
</span><span id="line-59"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#null"><span class="hs-identifier">null</span></a></span><span class="hs-special">,</span><span>                   </span><span class="hs-comment">-- :: ByteString -&gt; Bool</span><span>
</span><span id="line-60"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#length"><span class="hs-identifier">length</span></a></span><span class="hs-special">,</span><span>                 </span><span class="hs-comment">-- :: ByteString -&gt; Int64</span><span>
</span><span id="line-61"></span><span>
</span><span id="line-62"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Transforming ByteStrings</span></span><span>
</span><span id="line-63"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#map"><span class="hs-identifier">map</span></a></span><span class="hs-special">,</span><span>                    </span><span class="hs-comment">-- :: (Char -&gt; Char) -&gt; ByteString -&gt; ByteString</span><span>
</span><span id="line-64"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#reverse"><span class="hs-identifier">reverse</span></a></span><span class="hs-special">,</span><span>                </span><span class="hs-comment">-- :: ByteString -&gt; ByteString</span><span>
</span><span id="line-65"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#intersperse"><span class="hs-identifier">intersperse</span></a></span><span class="hs-special">,</span><span>            </span><span class="hs-comment">-- :: Char -&gt; ByteString -&gt; ByteString</span><span>
</span><span id="line-66"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#intercalate"><span class="hs-identifier">intercalate</span></a></span><span class="hs-special">,</span><span>            </span><span class="hs-comment">-- :: ByteString -&gt; [ByteString] -&gt; ByteString</span><span>
</span><span id="line-67"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#transpose"><span class="hs-identifier">transpose</span></a></span><span class="hs-special">,</span><span>              </span><span class="hs-comment">-- :: [ByteString] -&gt; [ByteString]</span><span>
</span><span id="line-68"></span><span>
</span><span id="line-69"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Reducing 'ByteString's (folds)</span></span><span>
</span><span id="line-70"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#foldl"><span class="hs-identifier">foldl</span></a></span><span class="hs-special">,</span><span>                  </span><span class="hs-comment">-- :: (a -&gt; Char -&gt; a) -&gt; a -&gt; ByteString -&gt; a</span><span>
</span><span id="line-71"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#foldl%27"><span class="hs-identifier">foldl'</span></a></span><span class="hs-special">,</span><span>                 </span><span class="hs-comment">-- :: (a -&gt; Char -&gt; a) -&gt; a -&gt; ByteString -&gt; a</span><span>
</span><span id="line-72"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#foldl1"><span class="hs-identifier">foldl1</span></a></span><span class="hs-special">,</span><span>                 </span><span class="hs-comment">-- :: (Char -&gt; Char -&gt; Char) -&gt; ByteString -&gt; Char</span><span>
</span><span id="line-73"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#foldl1%27"><span class="hs-identifier">foldl1'</span></a></span><span class="hs-special">,</span><span>                </span><span class="hs-comment">-- :: (Char -&gt; Char -&gt; Char) -&gt; ByteString -&gt; Char</span><span>
</span><span id="line-74"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#foldr"><span class="hs-identifier">foldr</span></a></span><span class="hs-special">,</span><span>                  </span><span class="hs-comment">-- :: (Char -&gt; a -&gt; a) -&gt; a -&gt; ByteString -&gt; a</span><span>
</span><span id="line-75"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#foldr1"><span class="hs-identifier">foldr1</span></a></span><span class="hs-special">,</span><span>                 </span><span class="hs-comment">-- :: (Char -&gt; Char -&gt; Char) -&gt; ByteString -&gt; Char</span><span>
</span><span id="line-76"></span><span>
</span><span id="line-77"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Special folds</span></span><span>
</span><span id="line-78"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#concat"><span class="hs-identifier">concat</span></a></span><span class="hs-special">,</span><span>                 </span><span class="hs-comment">-- :: [ByteString] -&gt; ByteString</span><span>
</span><span id="line-79"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#concatMap"><span class="hs-identifier">concatMap</span></a></span><span class="hs-special">,</span><span>              </span><span class="hs-comment">-- :: (Char -&gt; ByteString) -&gt; ByteString -&gt; ByteString</span><span>
</span><span id="line-80"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#any"><span class="hs-identifier">any</span></a></span><span class="hs-special">,</span><span>                    </span><span class="hs-comment">-- :: (Char -&gt; Bool) -&gt; ByteString -&gt; Bool</span><span>
</span><span id="line-81"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#all"><span class="hs-identifier">all</span></a></span><span class="hs-special">,</span><span>                    </span><span class="hs-comment">-- :: (Char -&gt; Bool) -&gt; ByteString -&gt; Bool</span><span>
</span><span id="line-82"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#maximum"><span class="hs-identifier">maximum</span></a></span><span class="hs-special">,</span><span>                </span><span class="hs-comment">-- :: ByteString -&gt; Char</span><span>
</span><span id="line-83"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#minimum"><span class="hs-identifier">minimum</span></a></span><span class="hs-special">,</span><span>                </span><span class="hs-comment">-- :: ByteString -&gt; Char</span><span>
</span><span id="line-84"></span><span>
</span><span id="line-85"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Building ByteStrings</span></span><span>
</span><span id="line-86"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Scans</span></span><span>
</span><span id="line-87"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#scanl"><span class="hs-identifier">scanl</span></a></span><span class="hs-special">,</span><span>                  </span><span class="hs-comment">-- :: (Char -&gt; Char -&gt; Char) -&gt; Char -&gt; ByteString -&gt; ByteString</span><span>
</span><span id="line-88"></span><span class="hs-comment">--      scanl1,                 -- :: (Char -&gt; Char -&gt; Char) -&gt; ByteString -&gt; ByteString</span><span>
</span><span id="line-89"></span><span class="hs-comment">--      scanr,                  -- :: (Char -&gt; Char -&gt; Char) -&gt; Char -&gt; ByteString -&gt; ByteString</span><span>
</span><span id="line-90"></span><span class="hs-comment">--      scanr1,                 -- :: (Char -&gt; Char -&gt; Char) -&gt; ByteString -&gt; ByteString</span><span>
</span><span id="line-91"></span><span>
</span><span id="line-92"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Accumulating maps</span></span><span>
</span><span id="line-93"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#mapAccumL"><span class="hs-identifier">mapAccumL</span></a></span><span class="hs-special">,</span><span>              </span><span class="hs-comment">-- :: (acc -&gt; Char -&gt; (acc, Char)) -&gt; acc -&gt; ByteString -&gt; (acc, ByteString)</span><span>
</span><span id="line-94"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#mapAccumR"><span class="hs-identifier">mapAccumR</span></a></span><span class="hs-special">,</span><span>              </span><span class="hs-comment">-- :: (acc -&gt; Char -&gt; (acc, Char)) -&gt; acc -&gt; ByteString -&gt; (acc, ByteString)</span><span>
</span><span id="line-95"></span><span>
</span><span id="line-96"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Infinite ByteStrings</span></span><span>
</span><span id="line-97"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#repeat"><span class="hs-identifier">repeat</span></a></span><span class="hs-special">,</span><span>                 </span><span class="hs-comment">-- :: Char -&gt; ByteString</span><span>
</span><span id="line-98"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#replicate"><span class="hs-identifier">replicate</span></a></span><span class="hs-special">,</span><span>              </span><span class="hs-comment">-- :: Int64 -&gt; Char -&gt; ByteString</span><span>
</span><span id="line-99"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#cycle"><span class="hs-identifier">cycle</span></a></span><span class="hs-special">,</span><span>                  </span><span class="hs-comment">-- :: ByteString -&gt; ByteString</span><span>
</span><span id="line-100"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#iterate"><span class="hs-identifier">iterate</span></a></span><span class="hs-special">,</span><span>                </span><span class="hs-comment">-- :: (Char -&gt; Char) -&gt; Char -&gt; ByteString</span><span>
</span><span id="line-101"></span><span>
</span><span id="line-102"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Unfolding ByteStrings</span></span><span>
</span><span id="line-103"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#unfoldr"><span class="hs-identifier">unfoldr</span></a></span><span class="hs-special">,</span><span>                </span><span class="hs-comment">-- :: (a -&gt; Maybe (Char, a)) -&gt; a -&gt; ByteString</span><span>
</span><span id="line-104"></span><span>
</span><span id="line-105"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Substrings</span></span><span>
</span><span id="line-106"></span><span>
</span><span id="line-107"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Breaking strings</span></span><span>
</span><span id="line-108"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#take"><span class="hs-identifier">take</span></a></span><span class="hs-special">,</span><span>                   </span><span class="hs-comment">-- :: Int64 -&gt; ByteString -&gt; ByteString</span><span>
</span><span id="line-109"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#drop"><span class="hs-identifier">drop</span></a></span><span class="hs-special">,</span><span>                   </span><span class="hs-comment">-- :: Int64 -&gt; ByteString -&gt; ByteString</span><span>
</span><span id="line-110"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#splitAt"><span class="hs-identifier">splitAt</span></a></span><span class="hs-special">,</span><span>                </span><span class="hs-comment">-- :: Int64 -&gt; ByteString -&gt; (ByteString, ByteString)</span><span>
</span><span id="line-111"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#takeWhile"><span class="hs-identifier">takeWhile</span></a></span><span class="hs-special">,</span><span>              </span><span class="hs-comment">-- :: (Char -&gt; Bool) -&gt; ByteString -&gt; ByteString</span><span>
</span><span id="line-112"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#dropWhile"><span class="hs-identifier">dropWhile</span></a></span><span class="hs-special">,</span><span>              </span><span class="hs-comment">-- :: (Char -&gt; Bool) -&gt; ByteString -&gt; ByteString</span><span>
</span><span id="line-113"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#span"><span class="hs-identifier">span</span></a></span><span class="hs-special">,</span><span>                   </span><span class="hs-comment">-- :: (Char -&gt; Bool) -&gt; ByteString -&gt; (ByteString, ByteString)</span><span>
</span><span id="line-114"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#break"><span class="hs-identifier">break</span></a></span><span class="hs-special">,</span><span>                  </span><span class="hs-comment">-- :: (Char -&gt; Bool) -&gt; ByteString -&gt; (ByteString, ByteString)</span><span>
</span><span id="line-115"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#group"><span class="hs-identifier">group</span></a></span><span class="hs-special">,</span><span>                  </span><span class="hs-comment">-- :: ByteString -&gt; [ByteString]</span><span>
</span><span id="line-116"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#groupBy"><span class="hs-identifier">groupBy</span></a></span><span class="hs-special">,</span><span>                </span><span class="hs-comment">-- :: (Char -&gt; Char -&gt; Bool) -&gt; ByteString -&gt; [ByteString]</span><span>
</span><span id="line-117"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#inits"><span class="hs-identifier">inits</span></a></span><span class="hs-special">,</span><span>                  </span><span class="hs-comment">-- :: ByteString -&gt; [ByteString]</span><span>
</span><span id="line-118"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#tails"><span class="hs-identifier">tails</span></a></span><span class="hs-special">,</span><span>                  </span><span class="hs-comment">-- :: ByteString -&gt; [ByteString]</span><span>
</span><span id="line-119"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#stripPrefix"><span class="hs-identifier">stripPrefix</span></a></span><span class="hs-special">,</span><span>            </span><span class="hs-comment">-- :: ByteString -&gt; ByteString -&gt; Maybe ByteString</span><span>
</span><span id="line-120"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#stripSuffix"><span class="hs-identifier">stripSuffix</span></a></span><span class="hs-special">,</span><span>            </span><span class="hs-comment">-- :: ByteString -&gt; ByteString -&gt; Maybe ByteString</span><span>
</span><span id="line-121"></span><span>
</span><span id="line-122"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Breaking into many substrings</span></span><span>
</span><span id="line-123"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#split"><span class="hs-identifier">split</span></a></span><span class="hs-special">,</span><span>                  </span><span class="hs-comment">-- :: Char -&gt; ByteString -&gt; [ByteString]</span><span>
</span><span id="line-124"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#splitWith"><span class="hs-identifier">splitWith</span></a></span><span class="hs-special">,</span><span>              </span><span class="hs-comment">-- :: (Char -&gt; Bool) -&gt; ByteString -&gt; [ByteString]</span><span>
</span><span id="line-125"></span><span>
</span><span id="line-126"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Breaking into lines and words</span></span><span>
</span><span id="line-127"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#lines"><span class="hs-identifier">lines</span></a></span><span class="hs-special">,</span><span>                  </span><span class="hs-comment">-- :: ByteString -&gt; [ByteString]</span><span>
</span><span id="line-128"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#words"><span class="hs-identifier">words</span></a></span><span class="hs-special">,</span><span>                  </span><span class="hs-comment">-- :: ByteString -&gt; [ByteString]</span><span>
</span><span id="line-129"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#unlines"><span class="hs-identifier">unlines</span></a></span><span class="hs-special">,</span><span>                </span><span class="hs-comment">-- :: [ByteString] -&gt; ByteString</span><span>
</span><span id="line-130"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#unwords"><span class="hs-identifier">unwords</span></a></span><span class="hs-special">,</span><span>                </span><span class="hs-comment">-- :: ByteString -&gt; [ByteString]</span><span>
</span><span id="line-131"></span><span>
</span><span id="line-132"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Predicates</span></span><span>
</span><span id="line-133"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#isPrefixOf"><span class="hs-identifier">isPrefixOf</span></a></span><span class="hs-special">,</span><span>             </span><span class="hs-comment">-- :: ByteString -&gt; ByteString -&gt; Bool</span><span>
</span><span id="line-134"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#isSuffixOf"><span class="hs-identifier">isSuffixOf</span></a></span><span class="hs-special">,</span><span>             </span><span class="hs-comment">-- :: ByteString -&gt; ByteString -&gt; Bool</span><span>
</span><span id="line-135"></span><span>
</span><span id="line-136"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Searching ByteStrings</span></span><span>
</span><span id="line-137"></span><span>
</span><span id="line-138"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Searching by equality</span></span><span>
</span><span id="line-139"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#elem"><span class="hs-identifier">elem</span></a></span><span class="hs-special">,</span><span>                   </span><span class="hs-comment">-- :: Char -&gt; ByteString -&gt; Bool</span><span>
</span><span id="line-140"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#notElem"><span class="hs-identifier">notElem</span></a></span><span class="hs-special">,</span><span>                </span><span class="hs-comment">-- :: Char -&gt; ByteString -&gt; Bool</span><span>
</span><span id="line-141"></span><span>
</span><span id="line-142"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Searching with a predicate</span></span><span>
</span><span id="line-143"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#find"><span class="hs-identifier">find</span></a></span><span class="hs-special">,</span><span>                   </span><span class="hs-comment">-- :: (Char -&gt; Bool) -&gt; ByteString -&gt; Maybe Char</span><span>
</span><span id="line-144"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#filter"><span class="hs-identifier">filter</span></a></span><span class="hs-special">,</span><span>                 </span><span class="hs-comment">-- :: (Char -&gt; Bool) -&gt; ByteString -&gt; ByteString</span><span>
</span><span id="line-145"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#partition"><span class="hs-identifier">partition</span></a></span><span class="hs-special">,</span><span>              </span><span class="hs-comment">-- :: (Char -&gt; Bool) -&gt; ByteString -&gt; (ByteString, ByteString)</span><span>
</span><span id="line-146"></span><span>
</span><span id="line-147"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Indexing ByteStrings</span></span><span>
</span><span id="line-148"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#index"><span class="hs-identifier">index</span></a></span><span class="hs-special">,</span><span>                  </span><span class="hs-comment">-- :: ByteString -&gt; Int64 -&gt; Char</span><span>
</span><span id="line-149"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#elemIndex"><span class="hs-identifier">elemIndex</span></a></span><span class="hs-special">,</span><span>              </span><span class="hs-comment">-- :: Char -&gt; ByteString -&gt; Maybe Int64</span><span>
</span><span id="line-150"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#elemIndices"><span class="hs-identifier">elemIndices</span></a></span><span class="hs-special">,</span><span>            </span><span class="hs-comment">-- :: Char -&gt; ByteString -&gt; [Int64]</span><span>
</span><span id="line-151"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#findIndex"><span class="hs-identifier">findIndex</span></a></span><span class="hs-special">,</span><span>              </span><span class="hs-comment">-- :: (Char -&gt; Bool) -&gt; ByteString -&gt; Maybe Int64</span><span>
</span><span id="line-152"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#findIndices"><span class="hs-identifier">findIndices</span></a></span><span class="hs-special">,</span><span>            </span><span class="hs-comment">-- :: (Char -&gt; Bool) -&gt; ByteString -&gt; [Int64]</span><span>
</span><span id="line-153"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#count"><span class="hs-identifier">count</span></a></span><span class="hs-special">,</span><span>                  </span><span class="hs-comment">-- :: Char -&gt; ByteString -&gt; Int64</span><span>
</span><span id="line-154"></span><span>
</span><span id="line-155"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Zipping and unzipping ByteStrings</span></span><span>
</span><span id="line-156"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#zip"><span class="hs-identifier">zip</span></a></span><span class="hs-special">,</span><span>                    </span><span class="hs-comment">-- :: ByteString -&gt; ByteString -&gt; [(Char,Char)]</span><span>
</span><span id="line-157"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#zipWith"><span class="hs-identifier">zipWith</span></a></span><span class="hs-special">,</span><span>                </span><span class="hs-comment">-- :: (Char -&gt; Char -&gt; c) -&gt; ByteString -&gt; ByteString -&gt; [c]</span><span>
</span><span id="line-158"></span><span class="hs-comment">--      unzip,                  -- :: [(Char,Char)] -&gt; (ByteString,ByteString)</span><span>
</span><span id="line-159"></span><span>
</span><span id="line-160"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Ordered ByteStrings</span></span><span>
</span><span id="line-161"></span><span class="hs-comment">--        sort,                   -- :: ByteString -&gt; ByteString</span><span>
</span><span id="line-162"></span><span>
</span><span id="line-163"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Low level conversions</span></span><span>
</span><span id="line-164"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Copying ByteStrings</span></span><span>
</span><span id="line-165"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#copy"><span class="hs-identifier">copy</span></a></span><span class="hs-special">,</span><span>                   </span><span class="hs-comment">-- :: ByteString -&gt; ByteString</span><span>
</span><span id="line-166"></span><span>
</span><span id="line-167"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Reading from ByteStrings</span></span><span>
</span><span id="line-168"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#readInt"><span class="hs-identifier">readInt</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-169"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#readInteger"><span class="hs-identifier">readInteger</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-170"></span><span>
</span><span id="line-171"></span><span>        </span><span class="annot"><span class="hs-comment">-- * I\/O with 'ByteString's</span></span><span>
</span><span id="line-172"></span><span>        </span><span class="hs-comment">-- | ByteString I/O uses binary mode, without any character decoding</span><span>
</span><span id="line-173"></span><span>        </span><span class="hs-comment">-- or newline conversion. The fact that it does not respect the Handle</span><span>
</span><span id="line-174"></span><span>        </span><span class="hs-comment">-- newline mode is considered a flaw and may be changed in a future version.</span><span>
</span><span id="line-175"></span><span>
</span><span id="line-176"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Standard input and output</span></span><span>
</span><span id="line-177"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#getContents"><span class="hs-identifier">getContents</span></a></span><span class="hs-special">,</span><span>            </span><span class="hs-comment">-- :: IO ByteString</span><span>
</span><span id="line-178"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#putStr"><span class="hs-identifier">putStr</span></a></span><span class="hs-special">,</span><span>                 </span><span class="hs-comment">-- :: ByteString -&gt; IO ()</span><span>
</span><span id="line-179"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#putStrLn"><span class="hs-identifier">putStrLn</span></a></span><span class="hs-special">,</span><span>               </span><span class="hs-comment">-- :: ByteString -&gt; IO ()</span><span>
</span><span id="line-180"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#interact"><span class="hs-identifier">interact</span></a></span><span class="hs-special">,</span><span>               </span><span class="hs-comment">-- :: (ByteString -&gt; ByteString) -&gt; IO ()</span><span>
</span><span id="line-181"></span><span>
</span><span id="line-182"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Files</span></span><span>
</span><span id="line-183"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#readFile"><span class="hs-identifier">readFile</span></a></span><span class="hs-special">,</span><span>               </span><span class="hs-comment">-- :: FilePath -&gt; IO ByteString</span><span>
</span><span id="line-184"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#writeFile"><span class="hs-identifier">writeFile</span></a></span><span class="hs-special">,</span><span>              </span><span class="hs-comment">-- :: FilePath -&gt; ByteString -&gt; IO ()</span><span>
</span><span id="line-185"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#appendFile"><span class="hs-identifier">appendFile</span></a></span><span class="hs-special">,</span><span>             </span><span class="hs-comment">-- :: FilePath -&gt; ByteString -&gt; IO ()</span><span>
</span><span id="line-186"></span><span>
</span><span id="line-187"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** I\/O with Handles</span></span><span>
</span><span id="line-188"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#hGetContents"><span class="hs-identifier">hGetContents</span></a></span><span class="hs-special">,</span><span>           </span><span class="hs-comment">-- :: Handle -&gt; IO ByteString</span><span>
</span><span id="line-189"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#hGet"><span class="hs-identifier">hGet</span></a></span><span class="hs-special">,</span><span>                   </span><span class="hs-comment">-- :: Handle -&gt; Int64 -&gt; IO ByteString</span><span>
</span><span id="line-190"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#hGetNonBlocking"><span class="hs-identifier">hGetNonBlocking</span></a></span><span class="hs-special">,</span><span>        </span><span class="hs-comment">-- :: Handle -&gt; Int64 -&gt; IO ByteString</span><span>
</span><span id="line-191"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#hPut"><span class="hs-identifier">hPut</span></a></span><span class="hs-special">,</span><span>                   </span><span class="hs-comment">-- :: Handle -&gt; ByteString -&gt; IO ()</span><span>
</span><span id="line-192"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#hPutNonBlocking"><span class="hs-identifier">hPutNonBlocking</span></a></span><span class="hs-special">,</span><span>        </span><span class="hs-comment">-- :: Handle -&gt; ByteString -&gt; IO ByteString</span><span>
</span><span id="line-193"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.html#hPutStr"><span class="hs-identifier">hPutStr</span></a></span><span class="hs-special">,</span><span>                </span><span class="hs-comment">-- :: Handle -&gt; ByteString -&gt; IO ()</span><span>
</span><span id="line-194"></span><span>        </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#hPutStrLn"><span class="hs-identifier">hPutStrLn</span></a></span><span class="hs-special">,</span><span>              </span><span class="hs-comment">-- :: Handle -&gt; ByteString -&gt; IO ()</span><span>
</span><span id="line-195"></span><span>
</span><span id="line-196"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-197"></span><span>
</span><span id="line-198"></span><span class="hs-comment">-- Functions transparently exported</span><span>
</span><span id="line-199"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.html"><span class="hs-identifier">Data.ByteString.Lazy</span></a></span><span>
</span><span id="line-200"></span><span>        </span><span class="hs-special">(</span><span class="annot"><a href="Data.ByteString.Lazy.html#fromChunks"><span class="hs-identifier">fromChunks</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.html#toChunks"><span class="hs-identifier">toChunks</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.html#fromStrict"><span class="hs-identifier">fromStrict</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.html#toStrict"><span class="hs-identifier">toStrict</span></a></span><span>
</span><span id="line-201"></span><span>        </span><span class="hs-special">,</span><span class="annot"><a href="Data.ByteString.Lazy.html#empty"><span class="hs-identifier">empty</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.ByteString.Lazy.html#null"><span class="hs-identifier">null</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.ByteString.Lazy.html#length"><span class="hs-identifier">length</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.ByteString.Lazy.html#tail"><span class="hs-identifier">tail</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.ByteString.Lazy.html#init"><span class="hs-identifier">init</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.ByteString.Lazy.html#append"><span class="hs-identifier">append</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.ByteString.Lazy.html#reverse"><span class="hs-identifier">reverse</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.ByteString.Lazy.html#transpose"><span class="hs-identifier">transpose</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.ByteString.Lazy.html#cycle"><span class="hs-identifier">cycle</span></a></span><span>
</span><span id="line-202"></span><span>        </span><span class="hs-special">,</span><span class="annot"><a href="Data.ByteString.Lazy.html#concat"><span class="hs-identifier">concat</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.ByteString.Lazy.html#take"><span class="hs-identifier">take</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.ByteString.Lazy.html#drop"><span class="hs-identifier">drop</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.ByteString.Lazy.html#splitAt"><span class="hs-identifier">splitAt</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.ByteString.Lazy.html#intercalate"><span class="hs-identifier">intercalate</span></a></span><span>
</span><span id="line-203"></span><span>        </span><span class="hs-special">,</span><span class="annot"><a href="Data.ByteString.Lazy.html#isPrefixOf"><span class="hs-identifier">isPrefixOf</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.ByteString.Lazy.html#isSuffixOf"><span class="hs-identifier">isSuffixOf</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.ByteString.Lazy.html#group"><span class="hs-identifier">group</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.ByteString.Lazy.html#inits"><span class="hs-identifier">inits</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.ByteString.Lazy.html#tails"><span class="hs-identifier">tails</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.ByteString.Lazy.html#copy"><span class="hs-identifier">copy</span></a></span><span>
</span><span id="line-204"></span><span>        </span><span class="hs-special">,</span><span class="annot"><a href="Data.ByteString.Lazy.html#stripPrefix"><span class="hs-identifier">stripPrefix</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.ByteString.Lazy.html#stripSuffix"><span class="hs-identifier">stripSuffix</span></a></span><span>
</span><span id="line-205"></span><span>        </span><span class="hs-special">,</span><span class="annot"><a href="Data.ByteString.Lazy.html#hGetContents"><span class="hs-identifier">hGetContents</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.html#hGet"><span class="hs-identifier">hGet</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.html#hPut"><span class="hs-identifier">hPut</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.html#getContents"><span class="hs-identifier">getContents</span></a></span><span>
</span><span id="line-206"></span><span>        </span><span class="hs-special">,</span><span class="annot"><a href="Data.ByteString.Lazy.html#hGetNonBlocking"><span class="hs-identifier">hGetNonBlocking</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.html#hPutNonBlocking"><span class="hs-identifier">hPutNonBlocking</span></a></span><span>
</span><span id="line-207"></span><span>        </span><span class="hs-special">,</span><span class="annot"><a href="Data.ByteString.Lazy.html#putStr"><span class="hs-identifier">putStr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.html#hPutStr"><span class="hs-identifier">hPutStr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.html#interact"><span class="hs-identifier">interact</span></a></span><span>
</span><span id="line-208"></span><span>        </span><span class="hs-special">,</span><span class="annot"><a href="Data.ByteString.Lazy.html#readFile"><span class="hs-identifier">readFile</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.ByteString.Lazy.html#writeFile"><span class="hs-identifier">writeFile</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.ByteString.Lazy.html#appendFile"><span class="hs-identifier">appendFile</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-209"></span><span>
</span><span id="line-210"></span><span class="hs-comment">-- Functions we need to wrap.</span><span>
</span><span id="line-211"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.html"><span class="hs-identifier">Data.ByteString.Lazy</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">L</span></span><span>
</span><span id="line-212"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Data.ByteString.html"><span class="hs-identifier">Data.ByteString</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">S</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.ByteString.Internal.html#ByteString"><span class="hs-identifier">ByteString</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- typename only</span><span>
</span><span id="line-213"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Data.ByteString.html"><span class="hs-identifier">Data.ByteString</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">B</span></span><span>
</span><span id="line-214"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Data.ByteString.Unsafe.html"><span class="hs-identifier">Data.ByteString.Unsafe</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">B</span></span><span>
</span><span id="line-215"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html"><span class="hs-identifier">Data.ByteString.Lazy.Internal</span></a></span><span>
</span><span id="line-216"></span><span>
</span><span id="line-217"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.ByteString.Internal.html"><span class="hs-identifier">Data.ByteString.Internal</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier">w2c</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Internal.html#c2w"><span class="hs-identifier">c2w</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Internal.html#isSpaceWord8"><span class="hs-identifier">isSpaceWord8</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-218"></span><span>
</span><span id="line-219"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Int.html#"><span class="hs-identifier">Data.Int</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier">Int64</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-220"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">List</span></span><span>
</span><span id="line-221"></span><span>
</span><span id="line-222"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Prelude.html#"><span class="hs-identifier">Prelude</span></a></span><span> </span><span class="hs-keyword">hiding</span><span>
</span><span id="line-223"></span><span>        </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier">reverse</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/GHC.List.html#head"><span class="hs-identifier">head</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/GHC.List.html#tail"><span class="hs-identifier">tail</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/GHC.List.html#last"><span class="hs-identifier">last</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/GHC.List.html#init"><span class="hs-identifier">init</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier">null</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier">length</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier">map</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/Data.OldList.html#lines"><span class="hs-identifier">lines</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/Data.Foldable.html#foldl"><span class="hs-identifier">foldl</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier">foldr</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/Data.OldList.html#unlines"><span class="hs-identifier">unlines</span></a></span><span>
</span><span id="line-224"></span><span>        </span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/Data.Foldable.html#concat"><span class="hs-identifier">concat</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/Data.Foldable.html#any"><span class="hs-identifier">any</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/GHC.List.html#take"><span class="hs-identifier">take</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/GHC.List.html#drop"><span class="hs-identifier">drop</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/GHC.List.html#splitAt"><span class="hs-identifier">splitAt</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/GHC.List.html#takeWhile"><span class="hs-identifier">takeWhile</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/GHC.List.html#dropWhile"><span class="hs-identifier">dropWhile</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/GHC.List.html#span"><span class="hs-identifier">span</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/GHC.List.html#break"><span class="hs-identifier">break</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/Data.Foldable.html#elem"><span class="hs-identifier">elem</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier">filter</span></a></span><span>
</span><span id="line-225"></span><span>        </span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/Data.OldList.html#unwords"><span class="hs-identifier">unwords</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/Data.OldList.html#words"><span class="hs-identifier">words</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/Data.Foldable.html#maximum"><span class="hs-identifier">maximum</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/Data.Foldable.html#minimum"><span class="hs-identifier">minimum</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/Data.Foldable.html#all"><span class="hs-identifier">all</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier">concatMap</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/GHC.List.html#scanl"><span class="hs-identifier">scanl</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/GHC.List.html#scanl1"><span class="hs-identifier">scanl1</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/Data.Foldable.html#foldl1"><span class="hs-identifier">foldl1</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/Data.Foldable.html#foldr1"><span class="hs-identifier">foldr1</span></a></span><span>
</span><span id="line-226"></span><span>        </span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/System.IO.html#readFile"><span class="hs-identifier">readFile</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/System.IO.html#writeFile"><span class="hs-identifier">writeFile</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/System.IO.html#appendFile"><span class="hs-identifier">appendFile</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/GHC.List.html#replicate"><span class="hs-identifier">replicate</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/System.IO.html#getContents"><span class="hs-identifier">getContents</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/System.IO.html#getLine"><span class="hs-identifier">getLine</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/System.IO.html#putStr"><span class="hs-identifier">putStr</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/System.IO.html#putStrLn"><span class="hs-identifier">putStrLn</span></a></span><span>
</span><span id="line-227"></span><span>        </span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/GHC.List.html#zip"><span class="hs-identifier">zip</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/GHC.List.html#zipWith"><span class="hs-identifier">zipWith</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/GHC.List.html#unzip"><span class="hs-identifier">unzip</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/Data.Foldable.html#notElem"><span class="hs-identifier">notElem</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/GHC.List.html#repeat"><span class="hs-identifier">repeat</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/GHC.List.html#iterate"><span class="hs-identifier">iterate</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/System.IO.html#interact"><span class="hs-identifier">interact</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/GHC.List.html#cycle"><span class="hs-identifier">cycle</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-228"></span><span>
</span><span id="line-229"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/System.IO.html#"><span class="hs-identifier">System.IO</span></a></span><span>            </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier">Handle</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.StdHandles.html#stdout"><span class="hs-identifier">stdout</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-230"></span><span>
</span><span id="line-231"></span><span class="hs-comment">------------------------------------------------------------------------</span><span>
</span><span id="line-232"></span><span>
</span><span id="line-233"></span><span class="hs-comment">-- | /O(1)/ Convert a 'Char' into a 'ByteString'</span><span>
</span><span id="line-234"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#singleton"><span class="hs-identifier hs-type">singleton</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span>
</span><span id="line-235"></span><span id="singleton"><span class="annot"><span class="annottext">singleton :: Char -&gt; ByteString
</span><a href="Data.ByteString.Lazy.Char8.html#singleton"><span class="hs-identifier hs-var hs-var">singleton</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; ByteString
</span><a href="Data.ByteString.Lazy.html#singleton"><span class="hs-identifier hs-var">L.singleton</span></a></span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; ByteString) -&gt; (Char -&gt; Word8) -&gt; Char -&gt; ByteString
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Word8
</span><a href="Data.ByteString.Internal.html#c2w"><span class="hs-identifier hs-var">c2w</span></a></span><span>
</span><span id="line-236"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#singleton"><span class="hs-pragma hs-type">singleton</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-237"></span><span>
</span><span id="line-238"></span><span class="hs-comment">-- | /O(n)/ Convert a 'String' into a 'ByteString'.</span><span>
</span><span id="line-239"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#pack"><span class="hs-identifier hs-type">pack</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span>
</span><span id="line-240"></span><span id="pack"><span class="annot"><span class="annottext">pack :: [Char] -&gt; ByteString
</span><a href="Data.ByteString.Lazy.Char8.html#pack"><span class="hs-identifier hs-var hs-var">pack</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; ByteString
</span><a href="Data.ByteString.Lazy.Internal.html#packChars"><span class="hs-identifier hs-var">packChars</span></a></span><span>
</span><span id="line-241"></span><span>
</span><span id="line-242"></span><span class="hs-comment">-- | /O(n)/ Converts a 'ByteString' to a 'String'.</span><span>
</span><span id="line-243"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#unpack"><span class="hs-identifier hs-type">unpack</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-244"></span><span id="unpack"><span class="annot"><span class="annottext">unpack :: ByteString -&gt; [Char]
</span><a href="Data.ByteString.Lazy.Char8.html#unpack"><span class="hs-identifier hs-var hs-var">unpack</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; [Char]
</span><a href="Data.ByteString.Lazy.Internal.html#unpackChars"><span class="hs-identifier hs-var">unpackChars</span></a></span><span>
</span><span id="line-245"></span><span>
</span><span id="line-246"></span><span class="hs-keyword">infixr</span><span> </span><span class="hs-number">5</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#cons"><span class="hs-operator hs-type">`cons`</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#cons%27"><span class="hs-operator hs-type">`cons'`</span></a></span><span> </span><span class="hs-comment">--same as list (:)</span><span>
</span><span id="line-247"></span><span class="hs-keyword">infixl</span><span> </span><span class="hs-number">5</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#snoc"><span class="hs-operator hs-type">`snoc`</span></a></span><span>
</span><span id="line-248"></span><span>
</span><span id="line-249"></span><span class="hs-comment">-- | /O(1)/ 'cons' is analogous to '(Prelude.:)' for lists.</span><span>
</span><span id="line-250"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#cons"><span class="hs-identifier hs-type">cons</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span>
</span><span id="line-251"></span><span id="cons"><span class="annot"><span class="annottext">cons :: Char -&gt; ByteString -&gt; ByteString
</span><a href="Data.ByteString.Lazy.Char8.html#cons"><span class="hs-identifier hs-var hs-var">cons</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; ByteString -&gt; ByteString
</span><a href="Data.ByteString.Lazy.html#cons"><span class="hs-identifier hs-var">L.cons</span></a></span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; ByteString -&gt; ByteString)
-&gt; (Char -&gt; Word8) -&gt; Char -&gt; ByteString -&gt; ByteString
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Word8
</span><a href="Data.ByteString.Internal.html#c2w"><span class="hs-identifier hs-var">c2w</span></a></span><span>
</span><span id="line-252"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#cons"><span class="hs-pragma hs-type">cons</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-253"></span><span>
</span><span id="line-254"></span><span class="hs-comment">-- | /O(1)/ Unlike 'cons', 'cons'' is</span><span>
</span><span id="line-255"></span><span class="hs-comment">-- strict in the ByteString that we are consing onto. More precisely, it forces</span><span>
</span><span id="line-256"></span><span class="hs-comment">-- the head and the first chunk. It does this because, for space efficiency, it</span><span>
</span><span id="line-257"></span><span class="hs-comment">-- may coalesce the new byte onto the first \'chunk\' rather than starting a</span><span>
</span><span id="line-258"></span><span class="hs-comment">-- new \'chunk\'.</span><span>
</span><span id="line-259"></span><span class="hs-comment">--</span><span>
</span><span id="line-260"></span><span class="hs-comment">-- So that means you can't use a lazy recursive contruction like this:</span><span>
</span><span id="line-261"></span><span class="hs-comment">--</span><span>
</span><span id="line-262"></span><span class="hs-comment">-- &gt; let xs = cons' c xs in xs</span><span>
</span><span id="line-263"></span><span class="hs-comment">--</span><span>
</span><span id="line-264"></span><span class="hs-comment">-- You can however use 'cons', as well as 'repeat' and 'cycle', to build</span><span>
</span><span id="line-265"></span><span class="hs-comment">-- infinite lazy ByteStrings.</span><span>
</span><span id="line-266"></span><span class="hs-comment">--</span><span>
</span><span id="line-267"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#cons%27"><span class="hs-identifier hs-type">cons'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span>
</span><span id="line-268"></span><span id="cons%27"><span class="annot"><span class="annottext">cons' :: Char -&gt; ByteString -&gt; ByteString
</span><a href="Data.ByteString.Lazy.Char8.html#cons%27"><span class="hs-identifier hs-var hs-var">cons'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; ByteString -&gt; ByteString
</span><a href="Data.ByteString.Lazy.html#cons%27"><span class="hs-identifier hs-var">L.cons'</span></a></span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; ByteString -&gt; ByteString)
-&gt; (Char -&gt; Word8) -&gt; Char -&gt; ByteString -&gt; ByteString
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Word8
</span><a href="Data.ByteString.Internal.html#c2w"><span class="hs-identifier hs-var">c2w</span></a></span><span>
</span><span id="line-269"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#cons%27"><span class="hs-pragma hs-type">cons'</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-270"></span><span>
</span><span id="line-271"></span><span class="hs-comment">-- | /O(n)/ Append a Char to the end of a 'ByteString'. Similar to</span><span>
</span><span id="line-272"></span><span class="hs-comment">-- 'cons', this function performs a memcpy.</span><span>
</span><span id="line-273"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#snoc"><span class="hs-identifier hs-type">snoc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span>
</span><span id="line-274"></span><span id="snoc"><span class="annot"><span class="annottext">snoc :: ByteString -&gt; Char -&gt; ByteString
</span><a href="Data.ByteString.Lazy.Char8.html#snoc"><span class="hs-identifier hs-var hs-var">snoc</span></a></span></span><span> </span><span id="local-6989586621679076214"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076214"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Word8 -&gt; ByteString
</span><a href="Data.ByteString.Lazy.html#snoc"><span class="hs-identifier hs-var">L.snoc</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076214"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; ByteString) -&gt; (Char -&gt; Word8) -&gt; Char -&gt; ByteString
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Word8
</span><a href="Data.ByteString.Internal.html#c2w"><span class="hs-identifier hs-var">c2w</span></a></span><span>
</span><span id="line-275"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#snoc"><span class="hs-pragma hs-type">snoc</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-276"></span><span>
</span><span id="line-277"></span><span class="hs-comment">-- | /O(1)/ Extract the first element of a ByteString, which must be non-empty.</span><span>
</span><span id="line-278"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#head"><span class="hs-identifier hs-type">head</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span>
</span><span id="line-279"></span><span id="head"><span class="annot"><span class="annottext">head :: ByteString -&gt; Char
</span><a href="Data.ByteString.Lazy.Char8.html#head"><span class="hs-identifier hs-var hs-var">head</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; Char) -&gt; (ByteString -&gt; Word8) -&gt; ByteString -&gt; Char
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Word8
</span><a href="Data.ByteString.Lazy.html#head"><span class="hs-identifier hs-var">L.head</span></a></span><span>
</span><span id="line-280"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#head"><span class="hs-pragma hs-type">head</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-281"></span><span>
</span><span id="line-282"></span><span class="hs-comment">-- | /O(1)/ Extract the head and tail of a ByteString, returning Nothing</span><span>
</span><span id="line-283"></span><span class="hs-comment">-- if it is empty.</span><span>
</span><span id="line-284"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#uncons"><span class="hs-identifier hs-type">uncons</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-285"></span><span id="uncons"><span class="annot"><span class="annottext">uncons :: ByteString -&gt; Maybe (Char, ByteString)
</span><a href="Data.ByteString.Lazy.Char8.html#uncons"><span class="hs-identifier hs-var hs-var">uncons</span></a></span></span><span> </span><span id="local-6989586621679076211"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076211"><span class="hs-identifier hs-var">bs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Maybe (Word8, ByteString)
</span><a href="Data.ByteString.Lazy.html#uncons"><span class="hs-identifier hs-var">L.uncons</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076211"><span class="hs-identifier hs-var">bs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-286"></span><span>                  </span><span class="annot"><span class="annottext">Maybe (Word8, ByteString)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe (Char, ByteString)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-287"></span><span>                  </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679076209"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076209"><span class="hs-identifier hs-var">w</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679076208"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076208"><span class="hs-identifier hs-var">bs'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Char, ByteString) -&gt; Maybe (Char, ByteString)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076209"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076208"><span class="hs-identifier hs-var">bs'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-288"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#uncons"><span class="hs-pragma hs-type">uncons</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-289"></span><span>
</span><span id="line-290"></span><span class="hs-comment">-- | /O(n\/c)/ Extract the 'init' and 'last' of a ByteString, returning Nothing</span><span>
</span><span id="line-291"></span><span class="hs-comment">-- if it is empty.</span><span>
</span><span id="line-292"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#unsnoc"><span class="hs-identifier hs-type">unsnoc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-293"></span><span id="unsnoc"><span class="annot"><span class="annottext">unsnoc :: ByteString -&gt; Maybe (ByteString, Char)
</span><a href="Data.ByteString.Lazy.Char8.html#unsnoc"><span class="hs-identifier hs-var hs-var">unsnoc</span></a></span></span><span> </span><span id="local-6989586621679076207"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076207"><span class="hs-identifier hs-var">bs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Maybe (ByteString, Word8)
</span><a href="Data.ByteString.Lazy.html#unsnoc"><span class="hs-identifier hs-var">L.unsnoc</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076207"><span class="hs-identifier hs-var">bs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-294"></span><span>                  </span><span class="annot"><span class="annottext">Maybe (ByteString, Word8)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe (ByteString, Char)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-295"></span><span>                  </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679076205"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076205"><span class="hs-identifier hs-var">bs'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679076204"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076204"><span class="hs-identifier hs-var">w</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(ByteString, Char) -&gt; Maybe (ByteString, Char)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076205"><span class="hs-identifier hs-var">bs'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076204"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-296"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#unsnoc"><span class="hs-pragma hs-type">unsnoc</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-297"></span><span>
</span><span id="line-298"></span><span class="hs-comment">-- | /O(1)/ Extract the last element of a packed string, which must be non-empty.</span><span>
</span><span id="line-299"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#last"><span class="hs-identifier hs-type">last</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span>
</span><span id="line-300"></span><span id="last"><span class="annot"><span class="annottext">last :: ByteString -&gt; Char
</span><a href="Data.ByteString.Lazy.Char8.html#last"><span class="hs-identifier hs-var hs-var">last</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; Char) -&gt; (ByteString -&gt; Word8) -&gt; ByteString -&gt; Char
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Word8
</span><a href="Data.ByteString.Lazy.html#last"><span class="hs-identifier hs-var">L.last</span></a></span><span>
</span><span id="line-301"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#last"><span class="hs-pragma hs-type">last</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-302"></span><span>
</span><span id="line-303"></span><span class="hs-comment">-- | /O(n)/ 'map' @f xs@ is the ByteString obtained by applying @f@ to each element of @xs@</span><span>
</span><span id="line-304"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#map"><span class="hs-identifier hs-type">map</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span>
</span><span id="line-305"></span><span id="map"><span class="annot"><span class="annottext">map :: (Char -&gt; Char) -&gt; ByteString -&gt; ByteString
</span><a href="Data.ByteString.Lazy.Char8.html#map"><span class="hs-identifier hs-var hs-var">map</span></a></span></span><span> </span><span id="local-6989586621679076202"><span class="annot"><span class="annottext">Char -&gt; Char
</span><a href="#local-6989586621679076202"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; Word8) -&gt; ByteString -&gt; ByteString
</span><a href="Data.ByteString.Lazy.html#map"><span class="hs-identifier hs-var">L.map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Word8
</span><a href="Data.ByteString.Internal.html#c2w"><span class="hs-identifier hs-var">c2w</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Word8) -&gt; (Word8 -&gt; Char) -&gt; Word8 -&gt; Word8
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char
</span><a href="#local-6989586621679076202"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Char) -&gt; (Word8 -&gt; Char) -&gt; Word8 -&gt; Char
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-306"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#map"><span class="hs-pragma hs-type">map</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-307"></span><span>
</span><span id="line-308"></span><span class="hs-comment">-- | /O(n)/ The 'intersperse' function takes a Char and a 'ByteString'</span><span>
</span><span id="line-309"></span><span class="hs-comment">-- and \`intersperses\' that Char between the elements of the</span><span>
</span><span id="line-310"></span><span class="hs-comment">-- 'ByteString'.  It is analogous to the intersperse function on Lists.</span><span>
</span><span id="line-311"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#intersperse"><span class="hs-identifier hs-type">intersperse</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span>
</span><span id="line-312"></span><span id="intersperse"><span class="annot"><span class="annottext">intersperse :: Char -&gt; ByteString -&gt; ByteString
</span><a href="Data.ByteString.Lazy.Char8.html#intersperse"><span class="hs-identifier hs-var hs-var">intersperse</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; ByteString -&gt; ByteString
</span><a href="Data.ByteString.Lazy.html#intersperse"><span class="hs-identifier hs-var">L.intersperse</span></a></span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; ByteString -&gt; ByteString)
-&gt; (Char -&gt; Word8) -&gt; Char -&gt; ByteString -&gt; ByteString
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Word8
</span><a href="Data.ByteString.Internal.html#c2w"><span class="hs-identifier hs-var">c2w</span></a></span><span>
</span><span id="line-313"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#intersperse"><span class="hs-pragma hs-type">intersperse</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-314"></span><span>
</span><span id="line-315"></span><span class="hs-comment">-- | 'foldl', applied to a binary operator, a starting value (typically</span><span>
</span><span id="line-316"></span><span class="hs-comment">-- the left-identity of the operator), and a ByteString, reduces the</span><span>
</span><span id="line-317"></span><span class="hs-comment">-- ByteString using the binary operator, from left to right.</span><span>
</span><span id="line-318"></span><span id="local-6989586621679076492"><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#foldl"><span class="hs-identifier hs-type">foldl</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679076492"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679076492"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679076492"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679076492"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-319"></span><span id="foldl"><span class="annot"><span class="annottext">foldl :: forall a. (a -&gt; Char -&gt; a) -&gt; a -&gt; ByteString -&gt; a
</span><a href="Data.ByteString.Lazy.Char8.html#foldl"><span class="hs-identifier hs-var hs-var">foldl</span></a></span></span><span> </span><span id="local-6989586621679076199"><span class="annot"><span class="annottext">a -&gt; Char -&gt; a
</span><a href="#local-6989586621679076199"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; Word8 -&gt; a) -&gt; a -&gt; ByteString -&gt; a
forall a. (a -&gt; Word8 -&gt; a) -&gt; a -&gt; ByteString -&gt; a
</span><a href="Data.ByteString.Lazy.html#foldl"><span class="hs-identifier hs-var">L.foldl</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679076197"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679076197"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679076196"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076196"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">a -&gt; Char -&gt; a
</span><a href="#local-6989586621679076199"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679076197"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076196"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-320"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#foldl"><span class="hs-pragma hs-type">foldl</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-321"></span><span>
</span><span id="line-322"></span><span class="hs-comment">-- | 'foldl'' is like foldl, but strict in the accumulator.</span><span>
</span><span id="line-323"></span><span id="local-6989586621679076195"><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#foldl%27"><span class="hs-identifier hs-type">foldl'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679076195"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679076195"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679076195"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679076195"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-324"></span><span id="foldl%27"><span class="annot"><span class="annottext">foldl' :: forall a. (a -&gt; Char -&gt; a) -&gt; a -&gt; ByteString -&gt; a
</span><a href="Data.ByteString.Lazy.Char8.html#foldl%27"><span class="hs-identifier hs-var hs-var">foldl'</span></a></span></span><span> </span><span id="local-6989586621679076194"><span class="annot"><span class="annottext">a -&gt; Char -&gt; a
</span><a href="#local-6989586621679076194"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; Word8 -&gt; a) -&gt; a -&gt; ByteString -&gt; a
forall a. (a -&gt; Word8 -&gt; a) -&gt; a -&gt; ByteString -&gt; a
</span><a href="Data.ByteString.Lazy.html#foldl%27"><span class="hs-identifier hs-var">L.foldl'</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679076192"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679076192"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679076191"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076191"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">a -&gt; Char -&gt; a
</span><a href="#local-6989586621679076194"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679076192"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076191"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-325"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#foldl%27"><span class="hs-pragma hs-type">foldl'</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-326"></span><span>
</span><span id="line-327"></span><span class="hs-comment">-- | 'foldr', applied to a binary operator, a starting value</span><span>
</span><span id="line-328"></span><span class="hs-comment">-- (typically the right-identity of the operator), and a packed string,</span><span>
</span><span id="line-329"></span><span class="hs-comment">-- reduces the packed string using the binary operator, from right to left.</span><span>
</span><span id="line-330"></span><span id="local-6989586621679076488"><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#foldr"><span class="hs-identifier hs-type">foldr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679076488"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679076488"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679076488"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679076488"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-331"></span><span id="foldr"><span class="annot"><span class="annottext">foldr :: forall a. (Char -&gt; a -&gt; a) -&gt; a -&gt; ByteString -&gt; a
</span><a href="Data.ByteString.Lazy.Char8.html#foldr"><span class="hs-identifier hs-var hs-var">foldr</span></a></span></span><span> </span><span id="local-6989586621679076190"><span class="annot"><span class="annottext">Char -&gt; a -&gt; a
</span><a href="#local-6989586621679076190"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; a -&gt; a) -&gt; a -&gt; ByteString -&gt; a
forall a. (Word8 -&gt; a -&gt; a) -&gt; a -&gt; ByteString -&gt; a
</span><a href="Data.ByteString.Lazy.html#foldr"><span class="hs-identifier hs-var">L.foldr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679076188"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076188"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679076187"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679076187"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Char -&gt; a -&gt; a
</span><a href="#local-6989586621679076190"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076188"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679076187"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-332"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#foldr"><span class="hs-pragma hs-type">foldr</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-333"></span><span>
</span><span id="line-334"></span><span class="hs-comment">-- | 'foldl1' is a variant of 'foldl' that has no starting value</span><span>
</span><span id="line-335"></span><span class="hs-comment">-- argument, and thus must be applied to non-empty 'ByteString's.</span><span>
</span><span id="line-336"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#foldl1"><span class="hs-identifier hs-type">foldl1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span>
</span><span id="line-337"></span><span id="foldl1"><span class="annot"><span class="annottext">foldl1 :: (Char -&gt; Char -&gt; Char) -&gt; ByteString -&gt; Char
</span><a href="Data.ByteString.Lazy.Char8.html#foldl1"><span class="hs-identifier hs-var hs-var">foldl1</span></a></span></span><span> </span><span id="local-6989586621679076186"><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Char
</span><a href="#local-6989586621679076186"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679076185"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076185"><span class="hs-identifier hs-var">ps</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Word8 -&gt; Word8 -&gt; Word8) -&gt; ByteString -&gt; Word8
</span><a href="Data.ByteString.Lazy.html#foldl1"><span class="hs-identifier hs-var">L.foldl1</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679076183"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076183"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679076182"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076182"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Word8
</span><a href="Data.ByteString.Internal.html#c2w"><span class="hs-identifier hs-var">c2w</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Char
</span><a href="#local-6989586621679076186"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076183"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076182"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076185"><span class="hs-identifier hs-var">ps</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-338"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#foldl1"><span class="hs-pragma hs-type">foldl1</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-339"></span><span>
</span><span id="line-340"></span><span class="hs-comment">-- | 'foldl1'' is like 'foldl1', but strict in the accumulator.</span><span>
</span><span id="line-341"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#foldl1%27"><span class="hs-identifier hs-type">foldl1'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span>
</span><span id="line-342"></span><span id="foldl1%27"><span class="annot"><span class="annottext">foldl1' :: (Char -&gt; Char -&gt; Char) -&gt; ByteString -&gt; Char
</span><a href="Data.ByteString.Lazy.Char8.html#foldl1%27"><span class="hs-identifier hs-var hs-var">foldl1'</span></a></span></span><span> </span><span id="local-6989586621679076181"><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Char
</span><a href="#local-6989586621679076181"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679076180"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076180"><span class="hs-identifier hs-var">ps</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Word8 -&gt; Word8 -&gt; Word8) -&gt; ByteString -&gt; Word8
</span><a href="Data.ByteString.Lazy.html#foldl1%27"><span class="hs-identifier hs-var">L.foldl1'</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679076178"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076178"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679076177"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076177"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Word8
</span><a href="Data.ByteString.Internal.html#c2w"><span class="hs-identifier hs-var">c2w</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Char
</span><a href="#local-6989586621679076181"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076178"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076177"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076180"><span class="hs-identifier hs-var">ps</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-343"></span><span>
</span><span id="line-344"></span><span class="hs-comment">-- | 'foldr1' is a variant of 'foldr' that has no starting value argument,</span><span>
</span><span id="line-345"></span><span class="hs-comment">-- and thus must be applied to non-empty 'ByteString's</span><span>
</span><span id="line-346"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#foldr1"><span class="hs-identifier hs-type">foldr1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span>
</span><span id="line-347"></span><span id="foldr1"><span class="annot"><span class="annottext">foldr1 :: (Char -&gt; Char -&gt; Char) -&gt; ByteString -&gt; Char
</span><a href="Data.ByteString.Lazy.Char8.html#foldr1"><span class="hs-identifier hs-var hs-var">foldr1</span></a></span></span><span> </span><span id="local-6989586621679076176"><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Char
</span><a href="#local-6989586621679076176"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679076175"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076175"><span class="hs-identifier hs-var">ps</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Word8 -&gt; Word8 -&gt; Word8) -&gt; ByteString -&gt; Word8
</span><a href="Data.ByteString.Lazy.html#foldr1"><span class="hs-identifier hs-var">L.foldr1</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679076173"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076173"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679076172"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076172"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Word8
</span><a href="Data.ByteString.Internal.html#c2w"><span class="hs-identifier hs-var">c2w</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Char
</span><a href="#local-6989586621679076176"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076173"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076172"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076175"><span class="hs-identifier hs-var">ps</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-348"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#foldr1"><span class="hs-pragma hs-type">foldr1</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-349"></span><span>
</span><span id="line-350"></span><span class="hs-comment">-- | Map a function over a 'ByteString' and concatenate the results</span><span>
</span><span id="line-351"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#concatMap"><span class="hs-identifier hs-type">concatMap</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span>
</span><span id="line-352"></span><span id="concatMap"><span class="annot"><span class="annottext">concatMap :: (Char -&gt; ByteString) -&gt; ByteString -&gt; ByteString
</span><a href="Data.ByteString.Lazy.Char8.html#concatMap"><span class="hs-identifier hs-var hs-var">concatMap</span></a></span></span><span> </span><span id="local-6989586621679076171"><span class="annot"><span class="annottext">Char -&gt; ByteString
</span><a href="#local-6989586621679076171"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; ByteString) -&gt; ByteString -&gt; ByteString
</span><a href="Data.ByteString.Lazy.html#concatMap"><span class="hs-identifier hs-var">L.concatMap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; ByteString
</span><a href="#local-6989586621679076171"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; ByteString) -&gt; (Word8 -&gt; Char) -&gt; Word8 -&gt; ByteString
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-353"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#concatMap"><span class="hs-pragma hs-type">concatMap</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-354"></span><span>
</span><span id="line-355"></span><span class="hs-comment">-- | Applied to a predicate and a ByteString, 'any' determines if</span><span>
</span><span id="line-356"></span><span class="hs-comment">-- any element of the 'ByteString' satisfies the predicate.</span><span>
</span><span id="line-357"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#any"><span class="hs-identifier hs-type">any</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span>
</span><span id="line-358"></span><span id="any"><span class="annot"><span class="annottext">any :: (Char -&gt; Bool) -&gt; ByteString -&gt; Bool
</span><a href="Data.ByteString.Lazy.Char8.html#any"><span class="hs-identifier hs-var hs-var">any</span></a></span></span><span> </span><span id="local-6989586621679076169"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679076169"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; Bool) -&gt; ByteString -&gt; Bool
</span><a href="Data.ByteString.Lazy.html#any"><span class="hs-identifier hs-var">L.any</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679076169"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; (Word8 -&gt; Char) -&gt; Word8 -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-359"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#any"><span class="hs-pragma hs-type">any</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-360"></span><span>
</span><span id="line-361"></span><span class="hs-comment">-- | Applied to a predicate and a 'ByteString', 'all' determines if</span><span>
</span><span id="line-362"></span><span class="hs-comment">-- all elements of the 'ByteString' satisfy the predicate.</span><span>
</span><span id="line-363"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#all"><span class="hs-identifier hs-type">all</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span>
</span><span id="line-364"></span><span id="all"><span class="annot"><span class="annottext">all :: (Char -&gt; Bool) -&gt; ByteString -&gt; Bool
</span><a href="Data.ByteString.Lazy.Char8.html#all"><span class="hs-identifier hs-var hs-var">all</span></a></span></span><span> </span><span id="local-6989586621679076167"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679076167"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; Bool) -&gt; ByteString -&gt; Bool
</span><a href="Data.ByteString.Lazy.html#all"><span class="hs-identifier hs-var">L.all</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679076167"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; (Word8 -&gt; Char) -&gt; Word8 -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-365"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#all"><span class="hs-pragma hs-type">all</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-366"></span><span>
</span><span id="line-367"></span><span class="hs-comment">-- | 'maximum' returns the maximum value from a 'ByteString'</span><span>
</span><span id="line-368"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#maximum"><span class="hs-identifier hs-type">maximum</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span>
</span><span id="line-369"></span><span id="maximum"><span class="annot"><span class="annottext">maximum :: ByteString -&gt; Char
</span><a href="Data.ByteString.Lazy.Char8.html#maximum"><span class="hs-identifier hs-var hs-var">maximum</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; Char) -&gt; (ByteString -&gt; Word8) -&gt; ByteString -&gt; Char
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Word8
</span><a href="Data.ByteString.Lazy.html#maximum"><span class="hs-identifier hs-var">L.maximum</span></a></span><span>
</span><span id="line-370"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#maximum"><span class="hs-pragma hs-type">maximum</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-371"></span><span>
</span><span id="line-372"></span><span class="hs-comment">-- | 'minimum' returns the minimum value from a 'ByteString'</span><span>
</span><span id="line-373"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#minimum"><span class="hs-identifier hs-type">minimum</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span>
</span><span id="line-374"></span><span id="minimum"><span class="annot"><span class="annottext">minimum :: ByteString -&gt; Char
</span><a href="Data.ByteString.Lazy.Char8.html#minimum"><span class="hs-identifier hs-var hs-var">minimum</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; Char) -&gt; (ByteString -&gt; Word8) -&gt; ByteString -&gt; Char
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Word8
</span><a href="Data.ByteString.Lazy.html#minimum"><span class="hs-identifier hs-var">L.minimum</span></a></span><span>
</span><span id="line-375"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#minimum"><span class="hs-pragma hs-type">minimum</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-376"></span><span>
</span><span id="line-377"></span><span class="hs-comment">-- ---------------------------------------------------------------------</span><span>
</span><span id="line-378"></span><span class="hs-comment">-- Building ByteStrings</span><span>
</span><span id="line-379"></span><span>
</span><span id="line-380"></span><span class="hs-comment">-- | 'scanl' is similar to 'foldl', but returns a list of successive</span><span>
</span><span id="line-381"></span><span class="hs-comment">-- reduced values from the left. This function will fuse.</span><span>
</span><span id="line-382"></span><span class="hs-comment">--</span><span>
</span><span id="line-383"></span><span class="hs-comment">-- &gt; scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]</span><span>
</span><span id="line-384"></span><span class="hs-comment">--</span><span>
</span><span id="line-385"></span><span class="hs-comment">-- Note that</span><span>
</span><span id="line-386"></span><span class="hs-comment">--</span><span>
</span><span id="line-387"></span><span class="hs-comment">-- &gt; last (scanl f z xs) == foldl f z xs.</span><span>
</span><span id="line-388"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#scanl"><span class="hs-identifier hs-type">scanl</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span>
</span><span id="line-389"></span><span id="scanl"><span class="annot"><span class="annottext">scanl :: (Char -&gt; Char -&gt; Char) -&gt; Char -&gt; ByteString -&gt; ByteString
</span><a href="Data.ByteString.Lazy.Char8.html#scanl"><span class="hs-identifier hs-var hs-var">scanl</span></a></span></span><span> </span><span id="local-6989586621679076163"><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Char
</span><a href="#local-6989586621679076163"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679076162"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679076162"><span class="hs-identifier hs-var">z</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; Word8 -&gt; Word8) -&gt; Word8 -&gt; ByteString -&gt; ByteString
</span><a href="Data.ByteString.Lazy.html#scanl"><span class="hs-identifier hs-var">L.scanl</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679076160"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076160"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679076159"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076159"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Word8
</span><a href="Data.ByteString.Internal.html#c2w"><span class="hs-identifier hs-var">c2w</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Char
</span><a href="#local-6989586621679076163"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076160"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076159"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Word8
</span><a href="Data.ByteString.Internal.html#c2w"><span class="hs-identifier hs-var">c2w</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679076162"><span class="hs-identifier hs-var">z</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-390"></span><span>
</span><span id="line-391"></span><span class="hs-comment">-- | The 'mapAccumL' function behaves like a combination of 'map' and</span><span>
</span><span id="line-392"></span><span class="hs-comment">-- 'foldl'; it applies a function to each element of a ByteString,</span><span>
</span><span id="line-393"></span><span class="hs-comment">-- passing an accumulating parameter from left to right, and returning a</span><span>
</span><span id="line-394"></span><span class="hs-comment">-- final value of this accumulator together with the new ByteString.</span><span>
</span><span id="line-395"></span><span id="local-6989586621679076485"><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#mapAccumL"><span class="hs-identifier hs-type">mapAccumL</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679076485"><span class="hs-identifier hs-type">acc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679076485"><span class="hs-identifier hs-type">acc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679076485"><span class="hs-identifier hs-type">acc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679076485"><span class="hs-identifier hs-type">acc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-396"></span><span id="mapAccumL"><span class="annot"><span class="annottext">mapAccumL :: forall acc.
(acc -&gt; Char -&gt; (acc, Char))
-&gt; acc -&gt; ByteString -&gt; (acc, ByteString)
</span><a href="Data.ByteString.Lazy.Char8.html#mapAccumL"><span class="hs-identifier hs-var hs-var">mapAccumL</span></a></span></span><span> </span><span id="local-6989586621679076158"><span class="annot"><span class="annottext">acc -&gt; Char -&gt; (acc, Char)
</span><a href="#local-6989586621679076158"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(acc -&gt; Word8 -&gt; (acc, Word8))
-&gt; acc -&gt; ByteString -&gt; (acc, ByteString)
forall acc.
(acc -&gt; Word8 -&gt; (acc, Word8))
-&gt; acc -&gt; ByteString -&gt; (acc, ByteString)
</span><a href="Data.ByteString.Lazy.html#mapAccumL"><span class="hs-identifier hs-var">L.mapAccumL</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679076156"><span class="annot"><span class="annottext">acc
</span><a href="#local-6989586621679076156"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679076155"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076155"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">acc -&gt; Char -&gt; (acc, Char)
</span><a href="#local-6989586621679076158"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">acc
</span><a href="#local-6989586621679076156"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076155"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679076154"><span class="annot"><span class="annottext">acc
</span><a href="#local-6989586621679076154"><span class="hs-identifier hs-var">a'</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679076153"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679076153"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">acc
</span><a href="#local-6989586621679076154"><span class="hs-identifier hs-var">a'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Word8
</span><a href="Data.ByteString.Internal.html#c2w"><span class="hs-identifier hs-var">c2w</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679076153"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-397"></span><span>
</span><span id="line-398"></span><span class="hs-comment">-- | The 'mapAccumR' function behaves like a combination of 'map' and</span><span>
</span><span id="line-399"></span><span class="hs-comment">-- 'foldr'; it applies a function to each element of a ByteString,</span><span>
</span><span id="line-400"></span><span class="hs-comment">-- passing an accumulating parameter from right to left, and returning a</span><span>
</span><span id="line-401"></span><span class="hs-comment">-- final value of this accumulator together with the new ByteString.</span><span>
</span><span id="line-402"></span><span id="local-6989586621679076152"><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#mapAccumR"><span class="hs-identifier hs-type">mapAccumR</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679076152"><span class="hs-identifier hs-type">acc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679076152"><span class="hs-identifier hs-type">acc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679076152"><span class="hs-identifier hs-type">acc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679076152"><span class="hs-identifier hs-type">acc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-403"></span><span id="mapAccumR"><span class="annot"><span class="annottext">mapAccumR :: forall acc.
(acc -&gt; Char -&gt; (acc, Char))
-&gt; acc -&gt; ByteString -&gt; (acc, ByteString)
</span><a href="Data.ByteString.Lazy.Char8.html#mapAccumR"><span class="hs-identifier hs-var hs-var">mapAccumR</span></a></span></span><span> </span><span id="local-6989586621679076151"><span class="annot"><span class="annottext">acc -&gt; Char -&gt; (acc, Char)
</span><a href="#local-6989586621679076151"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(acc -&gt; Word8 -&gt; (acc, Word8))
-&gt; acc -&gt; ByteString -&gt; (acc, ByteString)
forall acc.
(acc -&gt; Word8 -&gt; (acc, Word8))
-&gt; acc -&gt; ByteString -&gt; (acc, ByteString)
</span><a href="Data.ByteString.Lazy.html#mapAccumR"><span class="hs-identifier hs-var">L.mapAccumR</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679076149"><span class="annot"><span class="annottext">acc
</span><a href="#local-6989586621679076149"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span id="local-6989586621679076148"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076148"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">acc -&gt; Char -&gt; (acc, Char)
</span><a href="#local-6989586621679076151"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">acc
</span><a href="#local-6989586621679076149"><span class="hs-identifier hs-var">acc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076148"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679076147"><span class="annot"><span class="annottext">acc
</span><a href="#local-6989586621679076147"><span class="hs-identifier hs-var">acc'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679076146"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679076146"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">acc
</span><a href="#local-6989586621679076147"><span class="hs-identifier hs-var">acc'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Word8
</span><a href="Data.ByteString.Internal.html#c2w"><span class="hs-identifier hs-var">c2w</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679076146"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-404"></span><span>
</span><span id="line-405"></span><span class="hs-comment">------------------------------------------------------------------------</span><span>
</span><span id="line-406"></span><span class="hs-comment">-- Generating and unfolding ByteStrings</span><span>
</span><span id="line-407"></span><span>
</span><span id="line-408"></span><span class="hs-comment">-- | @'iterate' f x@ returns an infinite ByteString of repeated applications</span><span>
</span><span id="line-409"></span><span class="hs-comment">-- of @f@ to @x@:</span><span>
</span><span id="line-410"></span><span class="hs-comment">--</span><span>
</span><span id="line-411"></span><span class="hs-comment">-- &gt; iterate f x == [x, f x, f (f x), ...]</span><span>
</span><span id="line-412"></span><span class="hs-comment">--</span><span>
</span><span id="line-413"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#iterate"><span class="hs-identifier hs-type">iterate</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span>
</span><span id="line-414"></span><span id="iterate"><span class="annot"><span class="annottext">iterate :: (Char -&gt; Char) -&gt; Char -&gt; ByteString
</span><a href="Data.ByteString.Lazy.Char8.html#iterate"><span class="hs-identifier hs-var hs-var">iterate</span></a></span></span><span> </span><span id="local-6989586621679076145"><span class="annot"><span class="annottext">Char -&gt; Char
</span><a href="#local-6989586621679076145"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; Word8) -&gt; Word8 -&gt; ByteString
</span><a href="Data.ByteString.Lazy.html#iterate"><span class="hs-identifier hs-var">L.iterate</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Word8
</span><a href="Data.ByteString.Internal.html#c2w"><span class="hs-identifier hs-var">c2w</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Word8) -&gt; (Word8 -&gt; Char) -&gt; Word8 -&gt; Word8
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char
</span><a href="#local-6989586621679076145"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Char) -&gt; (Word8 -&gt; Char) -&gt; Word8 -&gt; Char
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; ByteString) -&gt; (Char -&gt; Word8) -&gt; Char -&gt; ByteString
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Word8
</span><a href="Data.ByteString.Internal.html#c2w"><span class="hs-identifier hs-var">c2w</span></a></span><span>
</span><span id="line-415"></span><span>
</span><span id="line-416"></span><span class="hs-comment">-- | @'repeat' x@ is an infinite ByteString, with @x@ the value of every</span><span>
</span><span id="line-417"></span><span class="hs-comment">-- element.</span><span>
</span><span id="line-418"></span><span class="hs-comment">--</span><span>
</span><span id="line-419"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#repeat"><span class="hs-identifier hs-type">repeat</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span>
</span><span id="line-420"></span><span id="repeat"><span class="annot"><span class="annottext">repeat :: Char -&gt; ByteString
</span><a href="Data.ByteString.Lazy.Char8.html#repeat"><span class="hs-identifier hs-var hs-var">repeat</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; ByteString
</span><a href="Data.ByteString.Lazy.html#repeat"><span class="hs-identifier hs-var">L.repeat</span></a></span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; ByteString) -&gt; (Char -&gt; Word8) -&gt; Char -&gt; ByteString
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Word8
</span><a href="Data.ByteString.Internal.html#c2w"><span class="hs-identifier hs-var">c2w</span></a></span><span>
</span><span id="line-421"></span><span>
</span><span id="line-422"></span><span class="hs-comment">-- | /O(n)/ @'replicate' n x@ is a ByteString of length @n@ with @x@</span><span>
</span><span id="line-423"></span><span class="hs-comment">-- the value of every element.</span><span>
</span><span id="line-424"></span><span class="hs-comment">--</span><span>
</span><span id="line-425"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#replicate"><span class="hs-identifier hs-type">replicate</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span>
</span><span id="line-426"></span><span id="replicate"><span class="annot"><span class="annottext">replicate :: Int64 -&gt; Char -&gt; ByteString
</span><a href="Data.ByteString.Lazy.Char8.html#replicate"><span class="hs-identifier hs-var hs-var">replicate</span></a></span></span><span> </span><span id="local-6989586621679076142"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679076142"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span id="local-6989586621679076141"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679076141"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Word8 -&gt; ByteString
</span><a href="Data.ByteString.Lazy.html#replicate"><span class="hs-identifier hs-var">L.replicate</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679076142"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Word8
</span><a href="Data.ByteString.Internal.html#c2w"><span class="hs-identifier hs-var">c2w</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679076141"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-427"></span><span>
</span><span id="line-428"></span><span class="hs-comment">-- | /O(n)/ The 'unfoldr' function is analogous to the List \'unfoldr\'.</span><span>
</span><span id="line-429"></span><span class="hs-comment">-- 'unfoldr' builds a ByteString from a seed value.  The function takes</span><span>
</span><span id="line-430"></span><span class="hs-comment">-- the element and returns 'Nothing' if it is done producing the</span><span>
</span><span id="line-431"></span><span class="hs-comment">-- ByteString or returns 'Just' @(a,b)@, in which case, @a@ is a</span><span>
</span><span id="line-432"></span><span class="hs-comment">-- prepending to the ByteString and @b@ is used as the next element in a</span><span>
</span><span id="line-433"></span><span class="hs-comment">-- recursive call.</span><span>
</span><span id="line-434"></span><span id="local-6989586621679076481"><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#unfoldr"><span class="hs-identifier hs-type">unfoldr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679076481"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679076481"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679076481"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span></span><span>
</span><span id="line-435"></span><span id="unfoldr"><span class="annot"><span class="annottext">unfoldr :: forall a. (a -&gt; Maybe (Char, a)) -&gt; a -&gt; ByteString
</span><a href="Data.ByteString.Lazy.Char8.html#unfoldr"><span class="hs-identifier hs-var hs-var">unfoldr</span></a></span></span><span> </span><span id="local-6989586621679076139"><span class="annot"><span class="annottext">a -&gt; Maybe (Char, a)
</span><a href="#local-6989586621679076139"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; Maybe (Word8, a)) -&gt; a -&gt; ByteString
forall a. (a -&gt; Maybe (Word8, a)) -&gt; a -&gt; ByteString
</span><a href="Data.ByteString.Lazy.html#unfoldr"><span class="hs-identifier hs-var">L.unfoldr</span></a></span><span> </span><span class="annot"><span class="annottext">((a -&gt; Maybe (Word8, a)) -&gt; a -&gt; ByteString)
-&gt; (a -&gt; Maybe (Word8, a)) -&gt; a -&gt; ByteString
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679076137"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679076137"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">a -&gt; Maybe (Char, a)
</span><a href="#local-6989586621679076139"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679076137"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-436"></span><span>                                    </span><span class="annot"><span class="annottext">Maybe (Char, a)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe (Word8, a)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-437"></span><span>                                    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679076136"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679076136"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679076135"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679076135"><span class="hs-identifier hs-var">a'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Word8, a) -&gt; Maybe (Word8, a)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Word8
</span><a href="Data.ByteString.Internal.html#c2w"><span class="hs-identifier hs-var">c2w</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679076136"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679076135"><span class="hs-identifier hs-var">a'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-438"></span><span>
</span><span id="line-439"></span><span class="hs-comment">------------------------------------------------------------------------</span><span>
</span><span id="line-440"></span><span>
</span><span id="line-441"></span><span class="hs-comment">-- | 'takeWhile', applied to a predicate @p@ and a ByteString @xs@,</span><span>
</span><span id="line-442"></span><span class="hs-comment">-- returns the longest prefix (possibly empty) of @xs@ of elements that</span><span>
</span><span id="line-443"></span><span class="hs-comment">-- satisfy @p@.</span><span>
</span><span id="line-444"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#takeWhile"><span class="hs-identifier hs-type">takeWhile</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span>
</span><span id="line-445"></span><span id="takeWhile"><span class="annot"><span class="annottext">takeWhile :: (Char -&gt; Bool) -&gt; ByteString -&gt; ByteString
</span><a href="Data.ByteString.Lazy.Char8.html#takeWhile"><span class="hs-identifier hs-var hs-var">takeWhile</span></a></span></span><span> </span><span id="local-6989586621679076134"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679076134"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; Bool) -&gt; ByteString -&gt; ByteString
</span><a href="Data.ByteString.Lazy.html#takeWhile"><span class="hs-identifier hs-var">L.takeWhile</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679076134"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; (Word8 -&gt; Char) -&gt; Word8 -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-446"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#takeWhile"><span class="hs-pragma hs-type">takeWhile</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-447"></span><span>
</span><span id="line-448"></span><span class="hs-comment">-- | 'dropWhile' @p xs@ returns the suffix remaining after 'takeWhile' @p xs@.</span><span>
</span><span id="line-449"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#dropWhile"><span class="hs-identifier hs-type">dropWhile</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span>
</span><span id="line-450"></span><span id="dropWhile"><span class="annot"><span class="annottext">dropWhile :: (Char -&gt; Bool) -&gt; ByteString -&gt; ByteString
</span><a href="Data.ByteString.Lazy.Char8.html#dropWhile"><span class="hs-identifier hs-var hs-var">dropWhile</span></a></span></span><span> </span><span id="local-6989586621679076132"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679076132"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; Bool) -&gt; ByteString -&gt; ByteString
</span><a href="Data.ByteString.Lazy.html#dropWhile"><span class="hs-identifier hs-var">L.dropWhile</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679076132"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; (Word8 -&gt; Char) -&gt; Word8 -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-451"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#dropWhile"><span class="hs-pragma hs-type">dropWhile</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-452"></span><span>
</span><span id="line-453"></span><span class="hs-comment">-- | 'break' @p@ is equivalent to @'span' ('not' . p)@.</span><span>
</span><span id="line-454"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#break"><span class="hs-identifier hs-type">break</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-455"></span><span id="break"><span class="annot"><span class="annottext">break :: (Char -&gt; Bool) -&gt; ByteString -&gt; (ByteString, ByteString)
</span><a href="Data.ByteString.Lazy.Char8.html#break"><span class="hs-identifier hs-var hs-var">break</span></a></span></span><span> </span><span id="local-6989586621679076130"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679076130"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; Bool) -&gt; ByteString -&gt; (ByteString, ByteString)
</span><a href="Data.ByteString.Lazy.html#break"><span class="hs-identifier hs-var">L.break</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679076130"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; (Word8 -&gt; Char) -&gt; Word8 -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-456"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#break"><span class="hs-pragma hs-type">break</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-457"></span><span>
</span><span id="line-458"></span><span class="hs-comment">-- | 'span' @p xs@ breaks the ByteString into two segments. It is</span><span>
</span><span id="line-459"></span><span class="hs-comment">-- equivalent to @('takeWhile' p xs, 'dropWhile' p xs)@</span><span>
</span><span id="line-460"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#span"><span class="hs-identifier hs-type">span</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-461"></span><span id="span"><span class="annot"><span class="annottext">span :: (Char -&gt; Bool) -&gt; ByteString -&gt; (ByteString, ByteString)
</span><a href="Data.ByteString.Lazy.Char8.html#span"><span class="hs-identifier hs-var hs-var">span</span></a></span></span><span> </span><span id="local-6989586621679076128"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679076128"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; Bool) -&gt; ByteString -&gt; (ByteString, ByteString)
</span><a href="Data.ByteString.Lazy.html#span"><span class="hs-identifier hs-var">L.span</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679076128"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; (Word8 -&gt; Char) -&gt; Word8 -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-462"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#span"><span class="hs-pragma hs-type">span</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-463"></span><span>
</span><span id="line-464"></span><span class="hs-comment">{-
-- | 'breakChar' breaks its ByteString argument at the first occurence
-- of the specified Char. It is more efficient than 'break' as it is
-- implemented with @memchr(3)@. I.e.
--
-- &gt; break (=='c') &quot;abcd&quot; == breakChar 'c' &quot;abcd&quot;
--
breakChar :: Char -&gt; ByteString -&gt; (ByteString, ByteString)
breakChar = L.breakByte . c2w
{-# INLINE breakChar #-}

-- | 'spanChar' breaks its ByteString argument at the first
-- occurence of a Char other than its argument. It is more efficient
-- than 'span (==)'
--
-- &gt; span  (=='c') &quot;abcd&quot; == spanByte 'c' &quot;abcd&quot;
--
spanChar :: Char -&gt; ByteString -&gt; (ByteString, ByteString)
spanChar = L.spanByte . c2w
{-# INLINE spanChar #-}
-}</span><span>
</span><span id="line-485"></span><span>
</span><span id="line-486"></span><span class="hs-comment">--</span><span>
</span><span id="line-487"></span><span class="hs-comment">-- TODO, more rules for breakChar*</span><span>
</span><span id="line-488"></span><span class="hs-comment">--</span><span>
</span><span id="line-489"></span><span>
</span><span id="line-490"></span><span class="hs-comment">-- | /O(n)/ Break a 'ByteString' into pieces separated by the byte</span><span>
</span><span id="line-491"></span><span class="hs-comment">-- argument, consuming the delimiter. I.e.</span><span>
</span><span id="line-492"></span><span class="hs-comment">--</span><span>
</span><span id="line-493"></span><span class="hs-comment">-- &gt; split '\n' &quot;a\nb\nd\ne&quot; == [&quot;a&quot;,&quot;b&quot;,&quot;d&quot;,&quot;e&quot;]</span><span>
</span><span id="line-494"></span><span class="hs-comment">-- &gt; split 'a'  &quot;aXaXaXa&quot;    == [&quot;&quot;,&quot;X&quot;,&quot;X&quot;,&quot;X&quot;]</span><span>
</span><span id="line-495"></span><span class="hs-comment">-- &gt; split 'x'  &quot;x&quot;          == [&quot;&quot;,&quot;&quot;]</span><span>
</span><span id="line-496"></span><span class="hs-comment">--</span><span>
</span><span id="line-497"></span><span class="hs-comment">-- and</span><span>
</span><span id="line-498"></span><span class="hs-comment">--</span><span>
</span><span id="line-499"></span><span class="hs-comment">-- &gt; intercalate [c] . split c == id</span><span>
</span><span id="line-500"></span><span class="hs-comment">-- &gt; split == splitWith . (==)</span><span>
</span><span id="line-501"></span><span class="hs-comment">--</span><span>
</span><span id="line-502"></span><span class="hs-comment">-- As for all splitting functions in this library, this function does</span><span>
</span><span id="line-503"></span><span class="hs-comment">-- not copy the substrings, it just constructs new 'ByteString's that</span><span>
</span><span id="line-504"></span><span class="hs-comment">-- are slices of the original.</span><span>
</span><span id="line-505"></span><span class="hs-comment">--</span><span>
</span><span id="line-506"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#split"><span class="hs-identifier hs-type">split</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-507"></span><span id="split"><span class="annot"><span class="annottext">split :: Char -&gt; ByteString -&gt; [ByteString]
</span><a href="Data.ByteString.Lazy.Char8.html#split"><span class="hs-identifier hs-var hs-var">split</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; ByteString -&gt; [ByteString]
</span><a href="Data.ByteString.Lazy.html#split"><span class="hs-identifier hs-var">L.split</span></a></span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; ByteString -&gt; [ByteString])
-&gt; (Char -&gt; Word8) -&gt; Char -&gt; ByteString -&gt; [ByteString]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Word8
</span><a href="Data.ByteString.Internal.html#c2w"><span class="hs-identifier hs-var">c2w</span></a></span><span>
</span><span id="line-508"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#split"><span class="hs-pragma hs-type">split</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-509"></span><span>
</span><span id="line-510"></span><span class="hs-comment">-- | /O(n)/ Splits a 'ByteString' into components delimited by</span><span>
</span><span id="line-511"></span><span class="hs-comment">-- separators, where the predicate returns True for a separator element.</span><span>
</span><span id="line-512"></span><span class="hs-comment">-- The resulting components do not contain the separators.  Two adjacent</span><span>
</span><span id="line-513"></span><span class="hs-comment">-- separators result in an empty component in the output.  eg.</span><span>
</span><span id="line-514"></span><span class="hs-comment">--</span><span>
</span><span id="line-515"></span><span class="hs-comment">-- &gt; splitWith (=='a') &quot;aabbaca&quot; == [&quot;&quot;,&quot;&quot;,&quot;bb&quot;,&quot;c&quot;,&quot;&quot;]</span><span>
</span><span id="line-516"></span><span class="hs-comment">--</span><span>
</span><span id="line-517"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#splitWith"><span class="hs-identifier hs-type">splitWith</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-518"></span><span id="splitWith"><span class="annot"><span class="annottext">splitWith :: (Char -&gt; Bool) -&gt; ByteString -&gt; [ByteString]
</span><a href="Data.ByteString.Lazy.Char8.html#splitWith"><span class="hs-identifier hs-var hs-var">splitWith</span></a></span></span><span> </span><span id="local-6989586621679076125"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679076125"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; Bool) -&gt; ByteString -&gt; [ByteString]
</span><a href="Data.ByteString.Lazy.html#splitWith"><span class="hs-identifier hs-var">L.splitWith</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679076125"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; (Word8 -&gt; Char) -&gt; Word8 -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-519"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#splitWith"><span class="hs-pragma hs-type">splitWith</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-520"></span><span>
</span><span id="line-521"></span><span class="hs-comment">-- | The 'groupBy' function is the non-overloaded version of 'group'.</span><span>
</span><span id="line-522"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#groupBy"><span class="hs-identifier hs-type">groupBy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-523"></span><span id="groupBy"><span class="annot"><span class="annottext">groupBy :: (Char -&gt; Char -&gt; Bool) -&gt; ByteString -&gt; [ByteString]
</span><a href="Data.ByteString.Lazy.Char8.html#groupBy"><span class="hs-identifier hs-var hs-var">groupBy</span></a></span></span><span> </span><span id="local-6989586621679076123"><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
</span><a href="#local-6989586621679076123"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; Word8 -&gt; Bool) -&gt; ByteString -&gt; [ByteString]
</span><a href="Data.ByteString.Lazy.html#groupBy"><span class="hs-identifier hs-var">L.groupBy</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679076121"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076121"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679076120"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076120"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
</span><a href="#local-6989586621679076123"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076121"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076120"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-524"></span><span>
</span><span id="line-525"></span><span class="hs-comment">-- | /O(1)/ 'ByteString' index (subscript) operator, starting from 0.</span><span>
</span><span id="line-526"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#index"><span class="hs-identifier hs-type">index</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span>
</span><span id="line-527"></span><span id="index"><span class="annot"><span class="annottext">index :: ByteString -&gt; Int64 -&gt; Char
</span><a href="Data.ByteString.Lazy.Char8.html#index"><span class="hs-identifier hs-var hs-var">index</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; Char) -&gt; (Int64 -&gt; Word8) -&gt; Int64 -&gt; Char
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">((Int64 -&gt; Word8) -&gt; Int64 -&gt; Char)
-&gt; (ByteString -&gt; Int64 -&gt; Word8) -&gt; ByteString -&gt; Int64 -&gt; Char
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Int64 -&gt; Word8
</span><a href="Data.ByteString.Lazy.html#index"><span class="hs-identifier hs-var">L.index</span></a></span><span>
</span><span id="line-528"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#index"><span class="hs-pragma hs-type">index</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-529"></span><span>
</span><span id="line-530"></span><span class="hs-comment">-- | /O(n)/ The 'elemIndex' function returns the index of the first</span><span>
</span><span id="line-531"></span><span class="hs-comment">-- element in the given 'ByteString' which is equal (by memchr) to the</span><span>
</span><span id="line-532"></span><span class="hs-comment">-- query element, or 'Nothing' if there is no such element.</span><span>
</span><span id="line-533"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#elemIndex"><span class="hs-identifier hs-type">elemIndex</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span>
</span><span id="line-534"></span><span id="elemIndex"><span class="annot"><span class="annottext">elemIndex :: Char -&gt; ByteString -&gt; Maybe Int64
</span><a href="Data.ByteString.Lazy.Char8.html#elemIndex"><span class="hs-identifier hs-var hs-var">elemIndex</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; ByteString -&gt; Maybe Int64
</span><a href="Data.ByteString.Lazy.html#elemIndex"><span class="hs-identifier hs-var">L.elemIndex</span></a></span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; ByteString -&gt; Maybe Int64)
-&gt; (Char -&gt; Word8) -&gt; Char -&gt; ByteString -&gt; Maybe Int64
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Word8
</span><a href="Data.ByteString.Internal.html#c2w"><span class="hs-identifier hs-var">c2w</span></a></span><span>
</span><span id="line-535"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#elemIndex"><span class="hs-pragma hs-type">elemIndex</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-536"></span><span>
</span><span id="line-537"></span><span class="hs-comment">-- | /O(n)/ The 'elemIndices' function extends 'elemIndex', by returning</span><span>
</span><span id="line-538"></span><span class="hs-comment">-- the indices of all elements equal to the query element, in ascending order.</span><span>
</span><span id="line-539"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#elemIndices"><span class="hs-identifier hs-type">elemIndices</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-540"></span><span id="elemIndices"><span class="annot"><span class="annottext">elemIndices :: Char -&gt; ByteString -&gt; [Int64]
</span><a href="Data.ByteString.Lazy.Char8.html#elemIndices"><span class="hs-identifier hs-var hs-var">elemIndices</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; ByteString -&gt; [Int64]
</span><a href="Data.ByteString.Lazy.html#elemIndices"><span class="hs-identifier hs-var">L.elemIndices</span></a></span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; ByteString -&gt; [Int64])
-&gt; (Char -&gt; Word8) -&gt; Char -&gt; ByteString -&gt; [Int64]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Word8
</span><a href="Data.ByteString.Internal.html#c2w"><span class="hs-identifier hs-var">c2w</span></a></span><span>
</span><span id="line-541"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#elemIndices"><span class="hs-pragma hs-type">elemIndices</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-542"></span><span>
</span><span id="line-543"></span><span class="hs-comment">-- | The 'findIndex' function takes a predicate and a 'ByteString' and</span><span>
</span><span id="line-544"></span><span class="hs-comment">-- returns the index of the first element in the ByteString satisfying the predicate.</span><span>
</span><span id="line-545"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#findIndex"><span class="hs-identifier hs-type">findIndex</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span>
</span><span id="line-546"></span><span id="findIndex"><span class="annot"><span class="annottext">findIndex :: (Char -&gt; Bool) -&gt; ByteString -&gt; Maybe Int64
</span><a href="Data.ByteString.Lazy.Char8.html#findIndex"><span class="hs-identifier hs-var hs-var">findIndex</span></a></span></span><span> </span><span id="local-6989586621679076116"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679076116"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; Bool) -&gt; ByteString -&gt; Maybe Int64
</span><a href="Data.ByteString.Lazy.html#findIndex"><span class="hs-identifier hs-var">L.findIndex</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679076116"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; (Word8 -&gt; Char) -&gt; Word8 -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-547"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#findIndex"><span class="hs-pragma hs-type">findIndex</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-548"></span><span>
</span><span id="line-549"></span><span class="hs-comment">-- | The 'findIndices' function extends 'findIndex', by returning the</span><span>
</span><span id="line-550"></span><span class="hs-comment">-- indices of all elements satisfying the predicate, in ascending order.</span><span>
</span><span id="line-551"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#findIndices"><span class="hs-identifier hs-type">findIndices</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-552"></span><span id="findIndices"><span class="annot"><span class="annottext">findIndices :: (Char -&gt; Bool) -&gt; ByteString -&gt; [Int64]
</span><a href="Data.ByteString.Lazy.Char8.html#findIndices"><span class="hs-identifier hs-var hs-var">findIndices</span></a></span></span><span> </span><span id="local-6989586621679076114"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679076114"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; Bool) -&gt; ByteString -&gt; [Int64]
</span><a href="Data.ByteString.Lazy.html#findIndices"><span class="hs-identifier hs-var">L.findIndices</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679076114"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; (Word8 -&gt; Char) -&gt; Word8 -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-553"></span><span>
</span><span id="line-554"></span><span class="hs-comment">-- | count returns the number of times its argument appears in the ByteString</span><span>
</span><span id="line-555"></span><span class="hs-comment">--</span><span>
</span><span id="line-556"></span><span class="hs-comment">-- &gt; count      == length . elemIndices</span><span>
</span><span id="line-557"></span><span class="hs-comment">-- &gt; count '\n' == length . lines</span><span>
</span><span id="line-558"></span><span class="hs-comment">--</span><span>
</span><span id="line-559"></span><span class="hs-comment">-- But more efficiently than using length on the intermediate list.</span><span>
</span><span id="line-560"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#count"><span class="hs-identifier hs-type">count</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span>
</span><span id="line-561"></span><span id="count"><span class="annot"><span class="annottext">count :: Char -&gt; ByteString -&gt; Int64
</span><a href="Data.ByteString.Lazy.Char8.html#count"><span class="hs-identifier hs-var hs-var">count</span></a></span></span><span> </span><span id="local-6989586621679076112"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679076112"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; ByteString -&gt; Int64
</span><a href="Data.ByteString.Lazy.html#count"><span class="hs-identifier hs-var">L.count</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Word8
</span><a href="Data.ByteString.Internal.html#c2w"><span class="hs-identifier hs-var">c2w</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679076112"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-562"></span><span>
</span><span id="line-563"></span><span class="hs-comment">-- | /O(n)/ 'elem' is the 'ByteString' membership predicate. This</span><span>
</span><span id="line-564"></span><span class="hs-comment">-- implementation uses @memchr(3)@.</span><span>
</span><span id="line-565"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#elem"><span class="hs-identifier hs-type">elem</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span>
</span><span id="line-566"></span><span id="elem"><span class="annot"><span class="annottext">elem :: Char -&gt; ByteString -&gt; Bool
</span><a href="Data.ByteString.Lazy.Char8.html#elem"><span class="hs-identifier hs-var hs-var">elem</span></a></span></span><span> </span><span id="local-6989586621679076110"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679076110"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; ByteString -&gt; Bool
</span><a href="Data.ByteString.Lazy.html#elem"><span class="hs-identifier hs-var">L.elem</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Word8
</span><a href="Data.ByteString.Internal.html#c2w"><span class="hs-identifier hs-var">c2w</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679076110"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-567"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#elem"><span class="hs-pragma hs-type">elem</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-568"></span><span>
</span><span id="line-569"></span><span class="hs-comment">-- | /O(n)/ 'notElem' is the inverse of 'elem'</span><span>
</span><span id="line-570"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#notElem"><span class="hs-identifier hs-type">notElem</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span>
</span><span id="line-571"></span><span id="notElem"><span class="annot"><span class="annottext">notElem :: Char -&gt; ByteString -&gt; Bool
</span><a href="Data.ByteString.Lazy.Char8.html#notElem"><span class="hs-identifier hs-var hs-var">notElem</span></a></span></span><span> </span><span id="local-6989586621679076108"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679076108"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; ByteString -&gt; Bool
</span><a href="Data.ByteString.Lazy.html#notElem"><span class="hs-identifier hs-var">L.notElem</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Word8
</span><a href="Data.ByteString.Internal.html#c2w"><span class="hs-identifier hs-var">c2w</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679076108"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-572"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#notElem"><span class="hs-pragma hs-type">notElem</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-573"></span><span>
</span><span id="line-574"></span><span class="hs-comment">-- | /O(n)/ 'filter', applied to a predicate and a ByteString,</span><span>
</span><span id="line-575"></span><span class="hs-comment">-- returns a ByteString containing those characters that satisfy the</span><span>
</span><span id="line-576"></span><span class="hs-comment">-- predicate.</span><span>
</span><span id="line-577"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#filter"><span class="hs-identifier hs-type">filter</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span>
</span><span id="line-578"></span><span id="filter"><span class="annot"><span class="annottext">filter :: (Char -&gt; Bool) -&gt; ByteString -&gt; ByteString
</span><a href="Data.ByteString.Lazy.Char8.html#filter"><span class="hs-identifier hs-var hs-var">filter</span></a></span></span><span> </span><span id="local-6989586621679076106"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679076106"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; Bool) -&gt; ByteString -&gt; ByteString
</span><a href="Data.ByteString.Lazy.html#filter"><span class="hs-identifier hs-var">L.filter</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679076106"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; (Word8 -&gt; Char) -&gt; Word8 -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-579"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#filter"><span class="hs-pragma hs-type">filter</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-580"></span><span>
</span><span id="line-581"></span><span class="hs-comment">-- | @since 0.10.12.0</span><span>
</span><span id="line-582"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#partition"><span class="hs-identifier hs-type">partition</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-583"></span><span id="partition"><span class="annot"><span class="annottext">partition :: (Char -&gt; Bool) -&gt; ByteString -&gt; (ByteString, ByteString)
</span><a href="Data.ByteString.Lazy.Char8.html#partition"><span class="hs-identifier hs-var hs-var">partition</span></a></span></span><span> </span><span id="local-6989586621679076104"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679076104"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; Bool) -&gt; ByteString -&gt; (ByteString, ByteString)
</span><a href="Data.ByteString.Lazy.html#partition"><span class="hs-identifier hs-var">L.partition</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679076104"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; (Word8 -&gt; Char) -&gt; Word8 -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-584"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#partition"><span class="hs-pragma hs-type">partition</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-585"></span><span>
</span><span id="line-586"></span><span class="hs-comment">{-
-- | /O(n)/ and /O(n\/c) space/ A first order equivalent of /filter .
-- (==)/, for the common case of filtering a single Char. It is more
-- efficient to use /filterChar/ in this case.
--
-- &gt; filterChar == filter . (==)
--
-- filterChar is around 10x faster, and uses much less space, than its
-- filter equivalent
--
filterChar :: Char -&gt; ByteString -&gt; ByteString
filterChar c ps = replicate (count c ps) c
{-# INLINE filterChar #-}

{-# RULES
  &quot;ByteString specialise filter (== x)&quot; forall x.
      filter ((==) x) = filterChar x
  #-}

{-# RULES
  &quot;ByteString specialise filter (== x)&quot; forall x.
     filter (== x) = filterChar x
  #-}
-}</span><span>
</span><span id="line-610"></span><span>
</span><span id="line-611"></span><span class="hs-comment">-- | /O(n)/ The 'find' function takes a predicate and a ByteString,</span><span>
</span><span id="line-612"></span><span class="hs-comment">-- and returns the first element in matching the predicate, or 'Nothing'</span><span>
</span><span id="line-613"></span><span class="hs-comment">-- if there is no such element.</span><span>
</span><span id="line-614"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#find"><span class="hs-identifier hs-type">find</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span>
</span><span id="line-615"></span><span id="find"><span class="annot"><span class="annottext">find :: (Char -&gt; Bool) -&gt; ByteString -&gt; Maybe Char
</span><a href="Data.ByteString.Lazy.Char8.html#find"><span class="hs-identifier hs-var hs-var">find</span></a></span></span><span> </span><span id="local-6989586621679076102"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679076102"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679076101"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076101"><span class="hs-identifier hs-var">ps</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; Char) -&gt; Maybe Word8 -&gt; Maybe Char
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-operator hs-var">`fmap`</span></a></span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; Bool) -&gt; ByteString -&gt; Maybe Word8
</span><a href="Data.ByteString.Lazy.html#find"><span class="hs-identifier hs-var">L.find</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679076102"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; (Word8 -&gt; Char) -&gt; Word8 -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076101"><span class="hs-identifier hs-var">ps</span></a></span><span>
</span><span id="line-616"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#find"><span class="hs-pragma hs-type">find</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-617"></span><span>
</span><span id="line-618"></span><span class="hs-comment">{-
-- | /O(n)/ A first order equivalent of /filter . (==)/, for the common
-- case of filtering a single Char. It is more efficient to use
-- filterChar in this case.
--
-- &gt; filterChar == filter . (==)
--
-- filterChar is around 10x faster, and uses much less space, than its
-- filter equivalent
--
filterChar :: Char -&gt; ByteString -&gt; ByteString
filterChar c = L.filterByte (c2w c)
{-# INLINE filterChar #-}

-- | /O(n)/ A first order equivalent of /filter . (\/=)/, for the common
-- case of filtering a single Char out of a list. It is more efficient
-- to use /filterNotChar/ in this case.
--
-- &gt; filterNotChar == filter . (/=)
--
-- filterNotChar is around 3x faster, and uses much less space, than its
-- filter equivalent
--
filterNotChar :: Char -&gt; ByteString -&gt; ByteString
filterNotChar c = L.filterNotByte (c2w c)
{-# INLINE filterNotChar #-}
-}</span><span>
</span><span id="line-645"></span><span>
</span><span id="line-646"></span><span class="hs-comment">-- | /O(n)/ 'zip' takes two ByteStrings and returns a list of</span><span>
</span><span id="line-647"></span><span class="hs-comment">-- corresponding pairs of Chars. If one input ByteString is short,</span><span>
</span><span id="line-648"></span><span class="hs-comment">-- excess elements of the longer ByteString are discarded. This is</span><span>
</span><span id="line-649"></span><span class="hs-comment">-- equivalent to a pair of 'unpack' operations, and so space</span><span>
</span><span id="line-650"></span><span class="hs-comment">-- usage may be large for multi-megabyte ByteStrings</span><span>
</span><span id="line-651"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#zip"><span class="hs-identifier hs-type">zip</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-652"></span><span id="zip"><span class="annot"><span class="annottext">zip :: ByteString -&gt; ByteString -&gt; [(Char, Char)]
</span><a href="Data.ByteString.Lazy.Char8.html#zip"><span class="hs-identifier hs-var hs-var">zip</span></a></span></span><span> </span><span id="local-6989586621679076099"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076099"><span class="hs-identifier hs-var">ps</span></a></span></span><span> </span><span id="local-6989586621679076098"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076098"><span class="hs-identifier hs-var">qs</span></a></span></span><span>
</span><span id="line-653"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Bool
</span><a href="Data.ByteString.Lazy.html#null"><span class="hs-identifier hs-var">L.null</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076099"><span class="hs-identifier hs-var">ps</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%7C%7C"><span class="hs-operator hs-var">||</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Bool
</span><a href="Data.ByteString.Lazy.html#null"><span class="hs-identifier hs-var">L.null</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076098"><span class="hs-identifier hs-var">qs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-654"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; Char
</span><a href="Data.ByteString.Lazy.Char8.html#head"><span class="hs-identifier hs-var">head</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076099"><span class="hs-identifier hs-var">ps</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Char
</span><a href="Data.ByteString.Lazy.Char8.html#head"><span class="hs-identifier hs-var">head</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076098"><span class="hs-identifier hs-var">qs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Char, Char) -&gt; [(Char, Char)] -&gt; [(Char, Char)]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; [(Char, Char)]
</span><a href="Data.ByteString.Lazy.Char8.html#zip"><span class="hs-identifier hs-var">zip</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; ByteString
</span><a href="Data.ByteString.Lazy.html#tail"><span class="hs-identifier hs-var">L.tail</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076099"><span class="hs-identifier hs-var">ps</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; ByteString
</span><a href="Data.ByteString.Lazy.html#tail"><span class="hs-identifier hs-var">L.tail</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076098"><span class="hs-identifier hs-var">qs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-655"></span><span>
</span><span id="line-656"></span><span class="hs-comment">-- | 'zipWith' generalises 'zip' by zipping with the function given as</span><span>
</span><span id="line-657"></span><span class="hs-comment">-- the first argument, instead of a tupling function.  For example,</span><span>
</span><span id="line-658"></span><span class="hs-comment">-- @'zipWith' (+)@ is applied to two ByteStrings to produce the list</span><span>
</span><span id="line-659"></span><span class="hs-comment">-- of corresponding sums.</span><span>
</span><span id="line-660"></span><span id="local-6989586621679076472"><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#zipWith"><span class="hs-identifier hs-type">zipWith</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679076472"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679076472"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-661"></span><span id="zipWith"><span class="annot"><span class="annottext">zipWith :: forall a. (Char -&gt; Char -&gt; a) -&gt; ByteString -&gt; ByteString -&gt; [a]
</span><a href="Data.ByteString.Lazy.Char8.html#zipWith"><span class="hs-identifier hs-var hs-var">zipWith</span></a></span></span><span> </span><span id="local-6989586621679076096"><span class="annot"><span class="annottext">Char -&gt; Char -&gt; a
</span><a href="#local-6989586621679076096"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; Word8 -&gt; a) -&gt; ByteString -&gt; ByteString -&gt; [a]
forall a. (Word8 -&gt; Word8 -&gt; a) -&gt; ByteString -&gt; ByteString -&gt; [a]
</span><a href="Data.ByteString.Lazy.html#zipWith"><span class="hs-identifier hs-var">L.zipWith</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Char -&gt; a) -&gt; (Word8 -&gt; Char) -&gt; Word8 -&gt; a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">((Char -&gt; a) -&gt; Word8 -&gt; a)
-&gt; (Word8 -&gt; Char -&gt; a) -&gt; Word8 -&gt; Word8 -&gt; a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; a
</span><a href="#local-6989586621679076096"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Char -&gt; a) -&gt; (Word8 -&gt; Char) -&gt; Word8 -&gt; Char -&gt; a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-662"></span><span>
</span><span id="line-663"></span><span class="hs-comment">-- | 'lines' breaks a ByteString up into a list of ByteStrings at</span><span>
</span><span id="line-664"></span><span class="hs-comment">-- newline Chars (@'\\n'@). The resulting strings do not contain newlines.</span><span>
</span><span id="line-665"></span><span class="hs-comment">--</span><span>
</span><span id="line-666"></span><span class="hs-comment">-- As of bytestring 0.9.0.3, this function is stricter than its</span><span>
</span><span id="line-667"></span><span class="hs-comment">-- list cousin.</span><span>
</span><span id="line-668"></span><span class="hs-comment">--</span><span>
</span><span id="line-669"></span><span class="hs-comment">-- Note that it __does not__ regard CR (@'\\r'@) as a newline character.</span><span>
</span><span id="line-670"></span><span class="hs-comment">--</span><span>
</span><span id="line-671"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#lines"><span class="hs-identifier hs-type">lines</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-672"></span><span id="lines"><span class="annot"><span class="annottext">lines :: ByteString -&gt; [ByteString]
</span><a href="Data.ByteString.Lazy.Char8.html#lines"><span class="hs-identifier hs-var hs-var">lines</span></a></span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="Data.ByteString.Lazy.Internal.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-673"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#lines"><span class="hs-identifier hs-var">lines</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679076092"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076092"><span class="hs-identifier hs-var">c0</span></a></span></span><span> </span><span id="local-6989586621679076091"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076091"><span class="hs-identifier hs-var">cs0</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; [ByteString]
</span><a href="#local-6989586621679076090"><span class="hs-identifier hs-var">loop0</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076092"><span class="hs-identifier hs-var">c0</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076091"><span class="hs-identifier hs-var">cs0</span></a></span><span>
</span><span id="line-674"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-675"></span><span>    </span><span class="hs-comment">-- this is a really performance sensitive function but the</span><span>
</span><span id="line-676"></span><span>    </span><span class="hs-comment">-- chunked representation makes the general case a bit expensive</span><span>
</span><span id="line-677"></span><span>    </span><span class="hs-comment">-- however assuming a large chunk size and normalish line lengths</span><span>
</span><span id="line-678"></span><span>    </span><span class="hs-comment">-- we will find line endings much more frequently than chunk</span><span>
</span><span id="line-679"></span><span>    </span><span class="hs-comment">-- endings so it makes sense to optimise for that common case.</span><span>
</span><span id="line-680"></span><span>    </span><span class="hs-comment">-- So we partition into two special cases depending on whether we</span><span>
</span><span id="line-681"></span><span>    </span><span class="hs-comment">-- are keeping back a list of chunks that will eventually be output</span><span>
</span><span id="line-682"></span><span>    </span><span class="hs-comment">-- once we get to the end of the current line.</span><span>
</span><span id="line-683"></span><span>
</span><span id="line-684"></span><span>    </span><span class="hs-comment">-- the common special case where we have no existing chunks of</span><span>
</span><span id="line-685"></span><span>    </span><span class="hs-comment">-- the current line</span><span>
</span><span id="line-686"></span><span>    </span><span class="annot"><a href="#local-6989586621679076090"><span class="hs-identifier hs-type">loop0</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">S.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-687"></span><span>    </span><span id="local-6989586621679076090"><span class="annot"><span class="annottext">loop0 :: ByteString -&gt; ByteString -&gt; [ByteString]
</span><a href="#local-6989586621679076090"><span class="hs-identifier hs-var hs-var">loop0</span></a></span></span><span> </span><span id="local-6989586621679076089"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076089"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679076088"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076088"><span class="hs-identifier hs-var">cs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-688"></span><span>        </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; ByteString -&gt; Maybe Int
</span><a href="Data.ByteString.html#elemIndex"><span class="hs-identifier hs-var">B.elemIndex</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Word8
</span><a href="Data.ByteString.Internal.html#c2w"><span class="hs-identifier hs-var">c2w</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\n'</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076089"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-689"></span><span>            </span><span class="annot"><span class="annottext">Maybe Int
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076088"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-690"></span><span>                           </span><span class="annot"><span class="annottext">ByteString
</span><a href="Data.ByteString.Lazy.Internal.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Bool
</span><a href="Data.ByteString.html#null"><span class="hs-identifier hs-var">B.null</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076089"><span class="hs-identifier hs-var">c</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span>                 </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-691"></span><span>                                  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; ByteString
</span><a href="Data.ByteString.Lazy.Internal.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076089"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="Data.ByteString.Lazy.Internal.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; [ByteString] -&gt; [ByteString]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-692"></span><span>                           </span><span class="hs-special">(</span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679076085"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076085"><span class="hs-identifier hs-var">c'</span></a></span></span><span> </span><span id="local-6989586621679076084"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076084"><span class="hs-identifier hs-var">cs'</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-693"></span><span>                               </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Bool
</span><a href="Data.ByteString.html#null"><span class="hs-identifier hs-var">B.null</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076089"><span class="hs-identifier hs-var">c</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; [ByteString]
</span><a href="#local-6989586621679076090"><span class="hs-identifier hs-var">loop0</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076085"><span class="hs-identifier hs-var">c'</span></a></span><span>     </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076084"><span class="hs-identifier hs-var">cs'</span></a></span><span>
</span><span id="line-694"></span><span>                               </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; [ByteString] -&gt; ByteString -&gt; [ByteString]
</span><a href="#local-6989586621679076083"><span class="hs-identifier hs-var">loop</span></a></span><span>  </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076085"><span class="hs-identifier hs-var">c'</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076089"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076084"><span class="hs-identifier hs-var">cs'</span></a></span><span>
</span><span id="line-695"></span><span>
</span><span id="line-696"></span><span>            </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679076082"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679076082"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679076082"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%2F%3D"><span class="hs-operator hs-var">/=</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; ByteString
</span><a href="Data.ByteString.Lazy.Internal.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; ByteString -&gt; ByteString
</span><a href="Data.ByteString.Unsafe.html#unsafeTake"><span class="hs-identifier hs-var">B.unsafeTake</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679076082"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076089"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="Data.ByteString.Lazy.Internal.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-697"></span><span>                                </span><span class="annot"><span class="annottext">ByteString -&gt; [ByteString] -&gt; [ByteString]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; [ByteString]
</span><a href="#local-6989586621679076090"><span class="hs-identifier hs-var">loop0</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; ByteString -&gt; ByteString
</span><a href="Data.ByteString.Unsafe.html#unsafeDrop"><span class="hs-identifier hs-var">B.unsafeDrop</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679076082"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076089"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076088"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-698"></span><span>                   </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="Data.ByteString.Lazy.Internal.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-699"></span><span>                                </span><span class="annot"><span class="annottext">ByteString -&gt; [ByteString] -&gt; [ByteString]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; [ByteString]
</span><a href="#local-6989586621679076090"><span class="hs-identifier hs-var">loop0</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; ByteString
</span><a href="Data.ByteString.Unsafe.html#unsafeTail"><span class="hs-identifier hs-var">B.unsafeTail</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076089"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076088"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-700"></span><span>
</span><span id="line-701"></span><span>    </span><span class="hs-comment">-- the general case when we are building a list of chunks that are</span><span>
</span><span id="line-702"></span><span>    </span><span class="hs-comment">-- part of the same line</span><span>
</span><span id="line-703"></span><span>    </span><span class="annot"><a href="#local-6989586621679076083"><span class="hs-identifier hs-type">loop</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">S.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">S.ByteString</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-704"></span><span>    </span><span id="local-6989586621679076083"><span class="annot"><span class="annottext">loop :: ByteString -&gt; [ByteString] -&gt; ByteString -&gt; [ByteString]
</span><a href="#local-6989586621679076083"><span class="hs-identifier hs-var hs-var">loop</span></a></span></span><span> </span><span id="local-6989586621679076076"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076076"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679076075"><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679076075"><span class="hs-identifier hs-var">line</span></a></span></span><span> </span><span id="local-6989586621679076074"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076074"><span class="hs-identifier hs-var">cs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-705"></span><span>        </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; ByteString -&gt; Maybe Int
</span><a href="Data.ByteString.html#elemIndex"><span class="hs-identifier hs-var">B.elemIndex</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Word8
</span><a href="Data.ByteString.Internal.html#c2w"><span class="hs-identifier hs-var">c2w</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\n'</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076076"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-706"></span><span>            </span><span class="annot"><span class="annottext">Maybe Int
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-707"></span><span>                </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076074"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-708"></span><span>                    </span><span class="annot"><span class="annottext">ByteString
</span><a href="Data.ByteString.Lazy.Internal.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679076073"><span class="annot"><span class="annottext">c' :: ByteString
</span><a href="#local-6989586621679076073"><span class="hs-identifier hs-var hs-var">c'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[ByteString] -&gt; ByteString
</span><a href="Data.ByteString.Lazy.Char8.html#revChunks"><span class="hs-identifier hs-var">revChunks</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076076"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; [ByteString] -&gt; [ByteString]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679076075"><span class="hs-identifier hs-var">line</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-709"></span><span>                              </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076073"><span class="hs-identifier hs-var">c'</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; [ByteString] -&gt; [ByteString]
</span><a href="../../ghc-prim/src/GHC.Prim.html#seq"><span class="hs-operator hs-var">`seq`</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076073"><span class="hs-identifier hs-var">c'</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; [ByteString] -&gt; [ByteString]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-710"></span><span>
</span><span id="line-711"></span><span>                    </span><span class="hs-special">(</span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679076071"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076071"><span class="hs-identifier hs-var">c'</span></a></span></span><span> </span><span id="local-6989586621679076070"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076070"><span class="hs-identifier hs-var">cs'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; [ByteString] -&gt; ByteString -&gt; [ByteString]
</span><a href="#local-6989586621679076083"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076071"><span class="hs-identifier hs-var">c'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076076"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; [ByteString] -&gt; [ByteString]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679076075"><span class="hs-identifier hs-var">line</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076070"><span class="hs-identifier hs-var">cs'</span></a></span><span>
</span><span id="line-712"></span><span>
</span><span id="line-713"></span><span>            </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679076069"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679076069"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-714"></span><span>                </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679076068"><span class="annot"><span class="annottext">c' :: ByteString
</span><a href="#local-6989586621679076068"><span class="hs-identifier hs-var hs-var">c'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[ByteString] -&gt; ByteString
</span><a href="Data.ByteString.Lazy.Char8.html#revChunks"><span class="hs-identifier hs-var">revChunks</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; ByteString -&gt; ByteString
</span><a href="Data.ByteString.Unsafe.html#unsafeTake"><span class="hs-identifier hs-var">B.unsafeTake</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679076069"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076076"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; [ByteString] -&gt; [ByteString]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679076075"><span class="hs-identifier hs-var">line</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-715"></span><span>                 </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076068"><span class="hs-identifier hs-var">c'</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; [ByteString] -&gt; [ByteString]
</span><a href="../../ghc-prim/src/GHC.Prim.html#seq"><span class="hs-operator hs-var">`seq`</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076068"><span class="hs-identifier hs-var">c'</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; [ByteString] -&gt; [ByteString]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; [ByteString]
</span><a href="#local-6989586621679076090"><span class="hs-identifier hs-var">loop0</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; ByteString -&gt; ByteString
</span><a href="Data.ByteString.Unsafe.html#unsafeDrop"><span class="hs-identifier hs-var">B.unsafeDrop</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679076069"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076076"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076074"><span class="hs-identifier hs-var">cs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-716"></span><span>
</span><span id="line-717"></span><span class="hs-comment">{-

This function is too strict!  Consider,

&gt; prop_lazy =
    (L.unpack . head . lazylines $ L.append (L.pack &quot;a\nb\n&quot;) (error &quot;failed&quot;))
  ==
    &quot;a&quot;

fails.  Here's a properly lazy version of 'lines' for lazy bytestrings

    lazylines           :: L.ByteString -&gt; [L.ByteString]
    lazylines s
        | L.null s  = []
        | otherwise =
            let (l,s') = L.break ((==) '\n') s
            in l : if L.null s' then []
                                else lazylines (L.tail s')

we need a similarly lazy, but efficient version.

-}</span><span>
</span><span id="line-739"></span><span>
</span><span id="line-740"></span><span>
</span><span id="line-741"></span><span class="hs-comment">-- | 'unlines' is an inverse operation to 'lines'.  It joins lines,</span><span>
</span><span id="line-742"></span><span class="hs-comment">-- after appending a terminating newline to each.</span><span>
</span><span id="line-743"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#unlines"><span class="hs-identifier hs-type">unlines</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span>
</span><span id="line-744"></span><span id="unlines"><span class="annot"><span class="annottext">unlines :: [ByteString] -&gt; ByteString
</span><a href="Data.ByteString.Lazy.Char8.html#unlines"><span class="hs-identifier hs-var hs-var">unlines</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="Data.ByteString.Lazy.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-745"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#unlines"><span class="hs-identifier hs-var">unlines</span></a></span><span> </span><span id="local-6989586621679076067"><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679076067"><span class="hs-identifier hs-var">ss</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[ByteString] -&gt; ByteString
</span><a href="Data.ByteString.Lazy.html#concat"><span class="hs-identifier hs-var">concat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; [ByteString] -&gt; [ByteString]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#intersperse"><span class="hs-identifier hs-var">List.intersperse</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076065"><span class="hs-identifier hs-var">nl</span></a></span><span> </span><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679076067"><span class="hs-identifier hs-var">ss</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; ByteString
</span><a href="Data.ByteString.Lazy.html#append"><span class="hs-operator hs-var">`append`</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076065"><span class="hs-identifier hs-var">nl</span></a></span><span> </span><span class="hs-comment">-- half as much space</span><span>
</span><span id="line-746"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679076065"><span class="annot"><span class="annottext">nl :: ByteString
</span><a href="#local-6989586621679076065"><span class="hs-identifier hs-var hs-var">nl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; ByteString
</span><a href="Data.ByteString.Lazy.Char8.html#singleton"><span class="hs-identifier hs-var">singleton</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\n'</span></span><span>
</span><span id="line-747"></span><span>
</span><span id="line-748"></span><span class="hs-comment">-- | 'words' breaks a ByteString up into a list of words, which</span><span>
</span><span id="line-749"></span><span class="hs-comment">-- were delimited by Chars representing white space. And</span><span>
</span><span id="line-750"></span><span class="hs-comment">--</span><span>
</span><span id="line-751"></span><span class="hs-comment">-- &gt; tokens isSpace = words</span><span>
</span><span id="line-752"></span><span class="hs-comment">--</span><span>
</span><span id="line-753"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#words"><span class="hs-identifier hs-type">words</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-754"></span><span id="words"><span class="annot"><span class="annottext">words :: ByteString -&gt; [ByteString]
</span><a href="Data.ByteString.Lazy.Char8.html#words"><span class="hs-identifier hs-var hs-var">words</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; Bool) -&gt; [ByteString] -&gt; [ByteString]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">List.filter</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#not"><span class="hs-identifier hs-var">not</span></a></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; Bool) -&gt; (ByteString -&gt; Bool) -&gt; ByteString -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Bool
</span><a href="Data.ByteString.Lazy.html#null"><span class="hs-identifier hs-var">L.null</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">([ByteString] -&gt; [ByteString])
-&gt; (ByteString -&gt; [ByteString]) -&gt; ByteString -&gt; [ByteString]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; Bool) -&gt; ByteString -&gt; [ByteString]
</span><a href="Data.ByteString.Lazy.html#splitWith"><span class="hs-identifier hs-var">L.splitWith</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Bool
</span><a href="Data.ByteString.Internal.html#isSpaceWord8"><span class="hs-identifier hs-var">isSpaceWord8</span></a></span><span>
</span><span id="line-755"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#words"><span class="hs-pragma hs-type">words</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-756"></span><span>
</span><span id="line-757"></span><span class="hs-comment">-- | The 'unwords' function is analogous to the 'unlines' function, on words.</span><span>
</span><span id="line-758"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#unwords"><span class="hs-identifier hs-type">unwords</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span>
</span><span id="line-759"></span><span id="unwords"><span class="annot"><span class="annottext">unwords :: [ByteString] -&gt; ByteString
</span><a href="Data.ByteString.Lazy.Char8.html#unwords"><span class="hs-identifier hs-var hs-var">unwords</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; [ByteString] -&gt; ByteString
</span><a href="Data.ByteString.Lazy.html#intercalate"><span class="hs-identifier hs-var">intercalate</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; ByteString
</span><a href="Data.ByteString.Lazy.Char8.html#singleton"><span class="hs-identifier hs-var">singleton</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">' '</span></span><span class="hs-special">)</span><span>
</span><span id="line-760"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#unwords"><span class="hs-pragma hs-type">unwords</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-761"></span><span>
</span><span id="line-762"></span><span class="hs-comment">-- | readInt reads an Int from the beginning of the ByteString.  If</span><span>
</span><span id="line-763"></span><span class="hs-comment">-- there is no integer at the beginning of the string, it returns</span><span>
</span><span id="line-764"></span><span class="hs-comment">-- Nothing, otherwise it just returns the int read, and the rest of the</span><span>
</span><span id="line-765"></span><span class="hs-comment">-- string.</span><span>
</span><span id="line-766"></span><span class="hs-comment">--</span><span>
</span><span id="line-767"></span><span class="hs-comment">-- Note: This function will overflow the Int for large integers.</span><span>
</span><span id="line-768"></span><span>
</span><span id="line-769"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#readInt"><span class="hs-identifier hs-type">readInt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-770"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#readInt"><span class="hs-pragma hs-type">readInt</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-771"></span><span id="readInt"><span class="annot"><span class="annottext">readInt :: ByteString -&gt; Maybe (Int, ByteString)
</span><a href="Data.ByteString.Lazy.Char8.html#readInt"><span class="hs-identifier hs-var hs-var">readInt</span></a></span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="Data.ByteString.Lazy.Internal.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Int, ByteString)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-772"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#readInt"><span class="hs-identifier hs-var">readInt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679076063"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076063"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679076062"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076062"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; Word8
</span><a href="Data.ByteString.Unsafe.html#unsafeHead"><span class="hs-identifier hs-var">B.unsafeHead</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076063"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-773"></span><span>    </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'-'</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
-&gt; Int
-&gt; Int
-&gt; ByteString
-&gt; ByteString
-&gt; Maybe (Int, ByteString)
</span><a href="#local-6989586621679076060"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span>  </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; ByteString
</span><a href="Data.ByteString.Unsafe.html#unsafeTail"><span class="hs-identifier hs-var">B.unsafeTail</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076063"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076062"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-774"></span><span>    </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'+'</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
-&gt; Int
-&gt; Int
-&gt; ByteString
-&gt; ByteString
-&gt; Maybe (Int, ByteString)
</span><a href="#local-6989586621679076060"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; ByteString
</span><a href="Data.ByteString.Unsafe.html#unsafeTail"><span class="hs-identifier hs-var">B.unsafeTail</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076063"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076062"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-775"></span><span>    </span><span class="annot"><span class="annottext">Char
</span><span class="hs-identifier">_</span></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
-&gt; Int
-&gt; Int
-&gt; ByteString
-&gt; ByteString
-&gt; Maybe (Int, ByteString)
</span><a href="#local-6989586621679076060"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076063"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076062"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-776"></span><span>
</span><span id="line-777"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span class="annot"><a href="#local-6989586621679076060"><span class="hs-identifier hs-type">loop</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>
</span><span id="line-778"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">S.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-779"></span><span>          </span><span id="local-6989586621679076060"><span class="annot"><span class="annottext">loop :: Bool
-&gt; Int
-&gt; Int
-&gt; ByteString
-&gt; ByteString
-&gt; Maybe (Int, ByteString)
</span><a href="#local-6989586621679076060"><span class="hs-identifier hs-var hs-var">loop</span></a></span></span><span> </span><span id="local-6989586621679076059"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679076059"><span class="hs-identifier hs-var">neg</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679076058"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679076058"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679076057"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679076057"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679076056"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076056"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679076055"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076055"><span class="hs-identifier hs-var">cs</span></a></span></span><span>
</span><span id="line-780"></span><span>              </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Bool
</span><a href="Data.ByteString.html#null"><span class="hs-identifier hs-var">B.null</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076056"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076055"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-781"></span><span>                             </span><span class="annot"><span class="annottext">ByteString
</span><a href="Data.ByteString.Lazy.Internal.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
-&gt; Int
-&gt; Int
-&gt; ByteString
-&gt; ByteString
-&gt; Maybe (Int, ByteString)
forall {a} {p}.
(Eq a, Num a, Num p) =&gt;
Bool -&gt; a -&gt; p -&gt; ByteString -&gt; ByteString -&gt; Maybe (p, ByteString)
</span><a href="#local-6989586621679076054"><span class="hs-identifier hs-var">end</span></a></span><span>  </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679076059"><span class="hs-identifier hs-var">neg</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679076058"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679076057"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076056"><span class="hs-identifier hs-var">c</span></a></span><span>  </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076055"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-782"></span><span>                             </span><span class="hs-special">(</span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679076053"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076053"><span class="hs-identifier hs-var">c'</span></a></span></span><span> </span><span id="local-6989586621679076052"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076052"><span class="hs-identifier hs-var">cs'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
-&gt; Int
-&gt; Int
-&gt; ByteString
-&gt; ByteString
-&gt; Maybe (Int, ByteString)
</span><a href="#local-6989586621679076060"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679076059"><span class="hs-identifier hs-var">neg</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679076058"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679076057"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076053"><span class="hs-identifier hs-var">c'</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076052"><span class="hs-identifier hs-var">cs'</span></a></span><span>
</span><span id="line-783"></span><span>              </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-784"></span><span>                  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Word8
</span><a href="Data.ByteString.Unsafe.html#unsafeHead"><span class="hs-identifier hs-var">B.unsafeHead</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076056"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-785"></span><span>                    </span><span id="local-6989586621679076051"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076051"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076051"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Word8 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3E%3D"><span class="hs-operator hs-var">&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0x30</span></span><span>
</span><span id="line-786"></span><span>                     </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%26%26"><span class="hs-operator hs-var">&amp;&amp;</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076051"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Word8 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C%3D"><span class="hs-operator hs-var">&lt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0x39</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
-&gt; Int
-&gt; Int
-&gt; ByteString
-&gt; ByteString
-&gt; Maybe (Int, ByteString)
</span><a href="#local-6989586621679076060"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679076059"><span class="hs-identifier hs-var">neg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679076058"><span class="hs-identifier hs-var">i</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-787"></span><span>                                          </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679076057"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">10</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8 -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076051"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0x30</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-788"></span><span>                                          </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; ByteString
</span><a href="Data.ByteString.Unsafe.html#unsafeTail"><span class="hs-identifier hs-var">B.unsafeTail</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076056"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076055"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-789"></span><span>                      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
-&gt; Int
-&gt; Int
-&gt; ByteString
-&gt; ByteString
-&gt; Maybe (Int, ByteString)
forall {a} {p}.
(Eq a, Num a, Num p) =&gt;
Bool -&gt; a -&gt; p -&gt; ByteString -&gt; ByteString -&gt; Maybe (p, ByteString)
</span><a href="#local-6989586621679076054"><span class="hs-identifier hs-var">end</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679076059"><span class="hs-identifier hs-var">neg</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679076058"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679076057"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076056"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076055"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-790"></span><span>
</span><span id="line-791"></span><span>          </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="#local-6989586621679076054"><span class="hs-pragma hs-type">end</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-792"></span><span>          </span><span id="local-6989586621679076054"><span class="annot"><span class="annottext">end :: Bool -&gt; a -&gt; p -&gt; ByteString -&gt; ByteString -&gt; Maybe (p, ByteString)
</span><a href="#local-6989586621679076054"><span class="hs-identifier hs-var hs-var">end</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span>   </span><span class="annot"><span class="annottext">a
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">p
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-identifier">_</span></span><span>  </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (p, ByteString)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-793"></span><span>          </span><span class="annot"><a href="#local-6989586621679076054"><span class="hs-identifier hs-var">end</span></a></span><span> </span><span id="local-6989586621679076042"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679076042"><span class="hs-identifier hs-var">neg</span></a></span></span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679076041"><span class="annot"><span class="annottext">p
</span><a href="#local-6989586621679076041"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679076040"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076040"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679076039"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076039"><span class="hs-identifier hs-var">cs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (p, ByteString)
</span><a href="#local-6989586621679076038"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-794"></span><span>                </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679076036"><span class="annot"><span class="annottext">n' :: p
</span><a href="#local-6989586621679076036"><span class="hs-identifier hs-var hs-var">n'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679076042"><span class="hs-identifier hs-var">neg</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">p -&gt; p
forall a. Num a =&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#negate"><span class="hs-identifier hs-var">negate</span></a></span><span> </span><span class="annot"><span class="annottext">p
</span><a href="#local-6989586621679076041"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">p
</span><a href="#local-6989586621679076041"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-795"></span><span>                      </span><span id="local-6989586621679076035"><span class="annot"><span class="annottext">c' :: ByteString
</span><a href="#local-6989586621679076035"><span class="hs-identifier hs-var hs-var">c'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; ByteString
</span><a href="Data.ByteString.Lazy.Internal.html#chunk"><span class="hs-identifier hs-var">chunk</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076040"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076039"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-796"></span><span>                      </span><span id="local-6989586621679076038"><span class="annot"><span class="annottext">e :: Maybe (p, ByteString)
</span><a href="#local-6989586621679076038"><span class="hs-identifier hs-var hs-var">e</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">p
</span><a href="#local-6989586621679076036"><span class="hs-identifier hs-var">n'</span></a></span><span> </span><span class="annot"><span class="annottext">p -&gt; Maybe (p, ByteString) -&gt; Maybe (p, ByteString)
</span><a href="../../ghc-prim/src/GHC.Prim.html#seq"><span class="hs-operator hs-var">`seq`</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076035"><span class="hs-identifier hs-var">c'</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Maybe (p, ByteString) -&gt; Maybe (p, ByteString)
</span><a href="../../ghc-prim/src/GHC.Prim.html#seq"><span class="hs-operator hs-var">`seq`</span></a></span><span> </span><span class="annot"><span class="annottext">(p, ByteString) -&gt; Maybe (p, ByteString)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">p
</span><a href="#local-6989586621679076036"><span class="hs-identifier hs-var">n'</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076035"><span class="hs-identifier hs-var">c'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-797"></span><span>         </span><span class="hs-comment">--                  in n' `seq` c' `seq` JustS n' c'</span><span>
</span><span id="line-798"></span><span>
</span><span id="line-799"></span><span>
</span><span id="line-800"></span><span class="hs-comment">-- | readInteger reads an Integer from the beginning of the ByteString.  If</span><span>
</span><span id="line-801"></span><span class="hs-comment">-- there is no integer at the beginning of the string, it returns Nothing,</span><span>
</span><span id="line-802"></span><span class="hs-comment">-- otherwise it just returns the int read, and the rest of the string.</span><span>
</span><span id="line-803"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#readInteger"><span class="hs-identifier hs-type">readInteger</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Integer.html#Integer"><span class="hs-identifier hs-type">Integer</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-804"></span><span id="readInteger"><span class="annot"><span class="annottext">readInteger :: ByteString -&gt; Maybe (Integer, ByteString)
</span><a href="Data.ByteString.Lazy.Char8.html#readInteger"><span class="hs-identifier hs-var hs-var">readInteger</span></a></span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="Data.ByteString.Lazy.Internal.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Integer, ByteString)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-805"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#readInteger"><span class="hs-identifier hs-var">readInteger</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679076033"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076033"><span class="hs-identifier hs-var">c0</span></a></span></span><span> </span><span id="local-6989586621679076032"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076032"><span class="hs-identifier hs-var">cs0</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-806"></span><span>        </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Char
</span><a href="Data.ByteString.Internal.html#w2c"><span class="hs-identifier hs-var">w2c</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; Word8
</span><a href="Data.ByteString.Unsafe.html#unsafeHead"><span class="hs-identifier hs-var">B.unsafeHead</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076033"><span class="hs-identifier hs-var">c0</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-807"></span><span>            </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'-'</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Maybe (Integer, ByteString)
</span><a href="#local-6989586621679076031"><span class="hs-identifier hs-var">first</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; ByteString
</span><a href="Data.ByteString.Unsafe.html#unsafeTail"><span class="hs-identifier hs-var">B.unsafeTail</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076033"><span class="hs-identifier hs-var">c0</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076032"><span class="hs-identifier hs-var">cs0</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (Integer, ByteString)
-&gt; ((Integer, ByteString) -&gt; Maybe (Integer, ByteString))
-&gt; Maybe (Integer, ByteString)
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621679076030"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679076030"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679076029"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076029"><span class="hs-identifier hs-var">cs'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Integer, ByteString) -&gt; Maybe (Integer, ByteString)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">-</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679076030"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076029"><span class="hs-identifier hs-var">cs'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-808"></span><span>            </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'+'</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Maybe (Integer, ByteString)
</span><a href="#local-6989586621679076031"><span class="hs-identifier hs-var">first</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; ByteString
</span><a href="Data.ByteString.Unsafe.html#unsafeTail"><span class="hs-identifier hs-var">B.unsafeTail</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076033"><span class="hs-identifier hs-var">c0</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076032"><span class="hs-identifier hs-var">cs0</span></a></span><span>
</span><span id="line-809"></span><span>            </span><span class="annot"><span class="annottext">Char
</span><span class="hs-identifier">_</span></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Maybe (Integer, ByteString)
</span><a href="#local-6989586621679076031"><span class="hs-identifier hs-var">first</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076033"><span class="hs-identifier hs-var">c0</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076032"><span class="hs-identifier hs-var">cs0</span></a></span><span>
</span><span id="line-810"></span><span>
</span><span id="line-811"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679076031"><span class="annot"><span class="annottext">first :: ByteString -&gt; ByteString -&gt; Maybe (Integer, ByteString)
</span><a href="#local-6989586621679076031"><span class="hs-identifier hs-var hs-var">first</span></a></span></span><span> </span><span id="local-6989586621679076028"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076028"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679076027"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076027"><span class="hs-identifier hs-var">cs</span></a></span></span><span>
</span><span id="line-812"></span><span>              </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Bool
</span><a href="Data.ByteString.html#null"><span class="hs-identifier hs-var">B.null</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076028"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076027"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-813"></span><span>                  </span><span class="annot"><span class="annottext">ByteString
</span><a href="Data.ByteString.Lazy.Internal.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe (Integer, ByteString)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-814"></span><span>                  </span><span class="hs-special">(</span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679076026"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076026"><span class="hs-identifier hs-var">c'</span></a></span></span><span> </span><span id="local-6989586621679076025"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076025"><span class="hs-identifier hs-var">cs'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Maybe (Integer, ByteString)
</span><a href="#local-6989586621679076024"><span class="hs-identifier hs-var">first'</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076026"><span class="hs-identifier hs-var">c'</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076025"><span class="hs-identifier hs-var">cs'</span></a></span><span>
</span><span id="line-815"></span><span>              </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Maybe (Integer, ByteString)
</span><a href="#local-6989586621679076024"><span class="hs-identifier hs-var">first'</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076028"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076027"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-816"></span><span>
</span><span id="line-817"></span><span>          </span><span id="local-6989586621679076024"><span class="annot"><span class="annottext">first' :: ByteString -&gt; ByteString -&gt; Maybe (Integer, ByteString)
</span><a href="#local-6989586621679076024"><span class="hs-identifier hs-var hs-var">first'</span></a></span></span><span> </span><span id="local-6989586621679076015"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076015"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679076014"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076014"><span class="hs-identifier hs-var">cs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Word8
</span><a href="Data.ByteString.Unsafe.html#unsafeHead"><span class="hs-identifier hs-var">B.unsafeHead</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076015"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-818"></span><span>              </span><span id="local-6989586621679076013"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076013"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076013"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Word8 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3E%3D"><span class="hs-operator hs-var">&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0x30</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%26%26"><span class="hs-operator hs-var">&amp;&amp;</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076013"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Word8 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C%3D"><span class="hs-operator hs-var">&lt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0x39</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Integer, ByteString) -&gt; Maybe (Integer, ByteString)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">((Integer, ByteString) -&gt; Maybe (Integer, ByteString))
-&gt; (Integer, ByteString) -&gt; Maybe (Integer, ByteString)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-819"></span><span>                  </span><span class="annot"><span class="annottext">Int
-&gt; Int
-&gt; [Integer]
-&gt; ByteString
-&gt; ByteString
-&gt; (Integer, ByteString)
</span><a href="#local-6989586621679076012"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8 -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076013"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0x30</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; ByteString
</span><a href="Data.ByteString.Unsafe.html#unsafeTail"><span class="hs-identifier hs-var">B.unsafeTail</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076015"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076014"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-820"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe (Integer, ByteString)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-821"></span><span>
</span><span id="line-822"></span><span>          </span><span class="annot"><a href="#local-6989586621679076012"><span class="hs-identifier hs-type">loop</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Integer.html#Integer"><span class="hs-identifier hs-type">Integer</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-823"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">S.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Integer.html#Integer"><span class="hs-identifier hs-type">Integer</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-824"></span><span>          </span><span id="local-6989586621679076012"><span class="annot"><span class="annottext">loop :: Int
-&gt; Int
-&gt; [Integer]
-&gt; ByteString
-&gt; ByteString
-&gt; (Integer, ByteString)
</span><a href="#local-6989586621679076012"><span class="hs-identifier hs-var hs-var">loop</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679076011"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679076011"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679076010"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679076010"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span id="local-6989586621679076009"><span class="annot"><span class="annottext">[Integer]
</span><a href="#local-6989586621679076009"><span class="hs-identifier hs-var">ns</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679076008"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076008"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679076007"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076007"><span class="hs-identifier hs-var">cs</span></a></span></span><span>
</span><span id="line-825"></span><span>              </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Bool
</span><a href="Data.ByteString.html#null"><span class="hs-identifier hs-var">B.null</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076008"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076007"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-826"></span><span>                             </span><span class="annot"><span class="annottext">ByteString
</span><a href="Data.ByteString.Lazy.Internal.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int
-&gt; Int
-&gt; [Integer]
-&gt; ByteString
-&gt; ByteString
-&gt; (Integer, ByteString)
forall {a} {b} {a}.
(Integral a, Integral b, Num a) =&gt;
b -&gt; a -&gt; [a] -&gt; ByteString -&gt; ByteString -&gt; (a, ByteString)
</span><a href="#local-6989586621679076006"><span class="hs-identifier hs-var">combine</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679076011"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679076010"><span class="hs-identifier hs-var">acc</span></a></span><span> </span><span class="annot"><span class="annottext">[Integer]
</span><a href="#local-6989586621679076009"><span class="hs-identifier hs-var">ns</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076008"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076007"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-827"></span><span>                             </span><span class="hs-special">(</span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679076005"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076005"><span class="hs-identifier hs-var">c'</span></a></span></span><span> </span><span id="local-6989586621679076004"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076004"><span class="hs-identifier hs-var">cs'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int
-&gt; Int
-&gt; [Integer]
-&gt; ByteString
-&gt; ByteString
-&gt; (Integer, ByteString)
</span><a href="#local-6989586621679076012"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679076011"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679076010"><span class="hs-identifier hs-var">acc</span></a></span><span> </span><span class="annot"><span class="annottext">[Integer]
</span><a href="#local-6989586621679076009"><span class="hs-identifier hs-var">ns</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076005"><span class="hs-identifier hs-var">c'</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076004"><span class="hs-identifier hs-var">cs'</span></a></span><span>
</span><span id="line-828"></span><span>              </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-829"></span><span>                  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Word8
</span><a href="Data.ByteString.Unsafe.html#unsafeHead"><span class="hs-identifier hs-var">B.unsafeHead</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076008"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-830"></span><span>                   </span><span id="local-6989586621679076003"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076003"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076003"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Word8 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3E%3D"><span class="hs-operator hs-var">&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0x30</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%26%26"><span class="hs-operator hs-var">&amp;&amp;</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076003"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Word8 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C%3D"><span class="hs-operator hs-var">&lt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0x39</span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-831"></span><span>                       </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679076011"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C"><span class="hs-operator hs-var">&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">9</span></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Int
-&gt; Int
-&gt; [Integer]
-&gt; ByteString
-&gt; ByteString
-&gt; (Integer, ByteString)
</span><a href="#local-6989586621679076012"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679076011"><span class="hs-identifier hs-var">d</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-832"></span><span>                                          </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">10</span></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679076010"><span class="hs-identifier hs-var">acc</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8 -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076003"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0x30</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-833"></span><span>                                          </span><span class="annot"><span class="annottext">[Integer]
</span><a href="#local-6989586621679076009"><span class="hs-identifier hs-var">ns</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; ByteString
</span><a href="Data.ByteString.Unsafe.html#unsafeTail"><span class="hs-identifier hs-var">B.unsafeTail</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076008"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076007"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-834"></span><span>                                </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Int
-&gt; Int
-&gt; [Integer]
-&gt; ByteString
-&gt; ByteString
-&gt; (Integer, ByteString)
</span><a href="#local-6989586621679076012"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8 -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679076003"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0x30</span></span><span class="hs-special">)</span><span>
</span><span id="line-835"></span><span>                                          </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Integer
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679076010"><span class="hs-identifier hs-var">acc</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; [Integer] -&gt; [Integer]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">[Integer]
</span><a href="#local-6989586621679076009"><span class="hs-identifier hs-var">ns</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-836"></span><span>                                          </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; ByteString
</span><a href="Data.ByteString.Unsafe.html#unsafeTail"><span class="hs-identifier hs-var">B.unsafeTail</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076008"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076007"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-837"></span><span>                     </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int
-&gt; Int
-&gt; [Integer]
-&gt; ByteString
-&gt; ByteString
-&gt; (Integer, ByteString)
forall {a} {b} {a}.
(Integral a, Integral b, Num a) =&gt;
b -&gt; a -&gt; [a] -&gt; ByteString -&gt; ByteString -&gt; (a, ByteString)
</span><a href="#local-6989586621679076006"><span class="hs-identifier hs-var">combine</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679076011"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679076010"><span class="hs-identifier hs-var">acc</span></a></span><span> </span><span class="annot"><span class="annottext">[Integer]
</span><a href="#local-6989586621679076009"><span class="hs-identifier hs-var">ns</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076008"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679076007"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-838"></span><span>
</span><span id="line-839"></span><span>          </span><span id="local-6989586621679076006"><span class="annot"><span class="annottext">combine :: b -&gt; a -&gt; [a] -&gt; ByteString -&gt; ByteString -&gt; (a, ByteString)
</span><a href="#local-6989586621679076006"><span class="hs-identifier hs-var hs-var">combine</span></a></span></span><span> </span><span class="annot"><span class="annottext">b
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679075987"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679075987"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span id="local-6989586621679075986"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679075986"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679075985"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679075985"><span class="hs-identifier hs-var">cs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; ByteString -&gt; ByteString -&gt; (a, ByteString)
forall {a}. a -&gt; ByteString -&gt; ByteString -&gt; (a, ByteString)
</span><a href="#local-6989586621679075984"><span class="hs-identifier hs-var">end</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; a
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679075987"><span class="hs-identifier hs-var">acc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679075986"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679075985"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-840"></span><span>          </span><span class="annot"><a href="#local-6989586621679076006"><span class="hs-identifier hs-var">combine</span></a></span><span> </span><span id="local-6989586621679075983"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679075983"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span id="local-6989586621679075982"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679075982"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span id="local-6989586621679075981"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679075981"><span class="hs-identifier hs-var">ns</span></a></span></span><span> </span><span id="local-6989586621679075980"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679075980"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679075979"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679075979"><span class="hs-identifier hs-var">cs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-841"></span><span>              </span><span class="annot"><span class="annottext">a -&gt; ByteString -&gt; ByteString -&gt; (a, ByteString)
forall {a}. a -&gt; ByteString -&gt; ByteString -&gt; (a, ByteString)
</span><a href="#local-6989586621679075984"><span class="hs-identifier hs-var">end</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><span class="hs-number">10</span></span><span class="annot"><span class="annottext">a -&gt; b -&gt; a
forall a b. (Num a, Integral b) =&gt; a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Real.html#%5E"><span class="hs-operator hs-var">^</span></a></span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679075983"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; a
forall {a}. Num a =&gt; a -&gt; [a] -&gt; a
</span><a href="#local-6989586621679075977"><span class="hs-identifier hs-var">combine1</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-number">1000000000</span></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679075981"><span class="hs-identifier hs-var">ns</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679075982"><span class="hs-identifier hs-var">acc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679075980"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679075979"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-842"></span><span>
</span><span id="line-843"></span><span>          </span><span id="local-6989586621679075977"><span class="annot"><span class="annottext">combine1 :: a -&gt; [a] -&gt; a
</span><a href="#local-6989586621679075977"><span class="hs-identifier hs-var hs-var">combine1</span></a></span></span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span id="local-6989586621679075973"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679075973"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679075973"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-844"></span><span>          </span><span class="annot"><a href="#local-6989586621679075977"><span class="hs-identifier hs-var">combine1</span></a></span><span> </span><span id="local-6989586621679075972"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679075972"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span id="local-6989586621679075971"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679075971"><span class="hs-identifier hs-var">ns</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; a
</span><a href="#local-6989586621679075977"><span class="hs-identifier hs-var">combine1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679075972"><span class="hs-identifier hs-var">b</span></a></span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679075972"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">([a] -&gt; a) -&gt; [a] -&gt; a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; [a]
forall {a}. Num a =&gt; a -&gt; [a] -&gt; [a]
</span><a href="#local-6989586621679075970"><span class="hs-identifier hs-var">combine2</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679075972"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679075971"><span class="hs-identifier hs-var">ns</span></a></span><span>
</span><span id="line-845"></span><span>
</span><span id="line-846"></span><span>          </span><span id="local-6989586621679075970"><span class="annot"><span class="annottext">combine2 :: a -&gt; [a] -&gt; [a]
</span><a href="#local-6989586621679075970"><span class="hs-identifier hs-var hs-var">combine2</span></a></span></span><span> </span><span id="local-6989586621679075968"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679075968"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679075967"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679075967"><span class="hs-identifier hs-var">n</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679075966"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679075966"><span class="hs-identifier hs-var">m</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679075965"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679075965"><span class="hs-identifier hs-var">ns</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679075962"><span class="annot"><span class="annottext">t :: a
</span><a href="#local-6989586621679075962"><span class="hs-identifier hs-var hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679075967"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679075966"><span class="hs-identifier hs-var">m</span></a></span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679075968"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679075962"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Prim.html#seq"><span class="hs-operator hs-var">`seq`</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679075962"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; [a]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; [a]
</span><a href="#local-6989586621679075970"><span class="hs-identifier hs-var">combine2</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679075968"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679075965"><span class="hs-identifier hs-var">ns</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-847"></span><span>          </span><span class="annot"><a href="#local-6989586621679075970"><span class="hs-identifier hs-var">combine2</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679075961"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679075961"><span class="hs-identifier hs-var">ns</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679075961"><span class="hs-identifier hs-var">ns</span></a></span><span>
</span><span id="line-848"></span><span>
</span><span id="line-849"></span><span>          </span><span id="local-6989586621679075984"><span class="annot"><span class="annottext">end :: a -&gt; ByteString -&gt; ByteString -&gt; (a, ByteString)
</span><a href="#local-6989586621679075984"><span class="hs-identifier hs-var hs-var">end</span></a></span></span><span> </span><span id="local-6989586621679075960"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679075960"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679075959"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679075959"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679075958"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679075958"><span class="hs-identifier hs-var">cs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679075957"><span class="annot"><span class="annottext">c' :: ByteString
</span><a href="#local-6989586621679075957"><span class="hs-identifier hs-var hs-var">c'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; ByteString
</span><a href="Data.ByteString.Lazy.Internal.html#chunk"><span class="hs-identifier hs-var">chunk</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679075959"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679075958"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-850"></span><span>                        </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679075957"><span class="hs-identifier hs-var">c'</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; (a, ByteString) -&gt; (a, ByteString)
</span><a href="../../ghc-prim/src/GHC.Prim.html#seq"><span class="hs-operator hs-var">`seq`</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679075960"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679075957"><span class="hs-identifier hs-var">c'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-851"></span><span>
</span><span id="line-852"></span><span>
</span><span id="line-853"></span><span class="hs-comment">-- | Write a ByteString to a handle, appending a newline byte</span><span>
</span><span id="line-854"></span><span class="hs-comment">--</span><span>
</span><span id="line-855"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#hPutStrLn"><span class="hs-identifier hs-type">hPutStrLn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-856"></span><span id="hPutStrLn"><span class="annot"><span class="annottext">hPutStrLn :: Handle -&gt; ByteString -&gt; IO ()
</span><a href="Data.ByteString.Lazy.Char8.html#hPutStrLn"><span class="hs-identifier hs-var hs-var">hPutStrLn</span></a></span></span><span> </span><span id="local-6989586621679075956"><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679075956"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span id="local-6989586621679075955"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679075955"><span class="hs-identifier hs-var">ps</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Handle -&gt; ByteString -&gt; IO ()
</span><a href="Data.ByteString.Lazy.html#hPut"><span class="hs-identifier hs-var">hPut</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679075956"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679075955"><span class="hs-identifier hs-var">ps</span></a></span><span> </span><span class="annot"><span class="annottext">IO () -&gt; IO () -&gt; IO ()
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Handle -&gt; ByteString -&gt; IO ()
</span><a href="Data.ByteString.Lazy.html#hPut"><span class="hs-identifier hs-var">hPut</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679075956"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8 -&gt; ByteString
</span><a href="Data.ByteString.Lazy.html#singleton"><span class="hs-identifier hs-var">L.singleton</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0x0a</span></span><span class="hs-special">)</span><span>
</span><span id="line-857"></span><span>
</span><span id="line-858"></span><span class="hs-comment">-- | Write a ByteString to stdout, appending a newline byte</span><span>
</span><span id="line-859"></span><span class="hs-comment">--</span><span>
</span><span id="line-860"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#putStrLn"><span class="hs-identifier hs-type">putStrLn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-861"></span><span id="putStrLn"><span class="annot"><span class="annottext">putStrLn :: ByteString -&gt; IO ()
</span><a href="Data.ByteString.Lazy.Char8.html#putStrLn"><span class="hs-identifier hs-var hs-var">putStrLn</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Handle -&gt; ByteString -&gt; IO ()
</span><a href="Data.ByteString.Lazy.Char8.html#hPutStrLn"><span class="hs-identifier hs-var">hPutStrLn</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="../../base/src/GHC.IO.StdHandles.html#stdout"><span class="hs-identifier hs-var">stdout</span></a></span><span>
</span><span id="line-862"></span><span>
</span><span id="line-863"></span><span class="hs-comment">-- ---------------------------------------------------------------------</span><span>
</span><span id="line-864"></span><span class="hs-comment">-- Internal utilities</span><span>
</span><span id="line-865"></span><span>
</span><span id="line-866"></span><span class="hs-comment">-- reverse a list of possibly-empty chunks into a lazy ByteString</span><span>
</span><span id="line-867"></span><span class="annot"><a href="Data.ByteString.Lazy.Char8.html#revChunks"><span class="hs-identifier hs-type">revChunks</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">S.ByteString</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span>
</span><span id="line-868"></span><span id="revChunks"><span class="annot"><span class="annottext">revChunks :: [ByteString] -&gt; ByteString
</span><a href="Data.ByteString.Lazy.Char8.html#revChunks"><span class="hs-identifier hs-var hs-var">revChunks</span></a></span></span><span> </span><span id="local-6989586621679075954"><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679075954"><span class="hs-identifier hs-var">cs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; ByteString -&gt; ByteString)
-&gt; ByteString -&gt; [ByteString] -&gt; ByteString
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">List.foldl'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(ByteString -&gt; ByteString -&gt; ByteString)
-&gt; ByteString -&gt; ByteString -&gt; ByteString
forall a b c. (a -&gt; b -&gt; c) -&gt; b -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#flip"><span class="hs-identifier hs-var">flip</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; ByteString
</span><a href="Data.ByteString.Lazy.Internal.html#chunk"><span class="hs-identifier hs-var">chunk</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="Data.ByteString.Lazy.Internal.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679075954"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-869"></span></pre></body></html>